package com.metel.mservice.common.encrypt;

import java.io.UnsupportedEncodingException;

/*
 * 
 * 
 * **/
public class AES128ECBUtil {

	private static int mode = 1;
	private static byte[] key = {(byte)0xf5, (byte)0x3a, (byte)0x88, 
		(byte)0x0a, (byte)0xdc, (byte)0x38, (byte)0x4d, (byte)0x27, (byte)0xd1, 
		(byte)0x09, (byte)0x19, (byte)0x77, (byte)0x91, (byte)0xa5, (byte)0x28, 
		(byte)0x33};
	
	private static byte[] internal_key = {(byte)0xf5, (byte)0x3a, (byte)0x88, 
		(byte)0x0a, (byte)0xdc, (byte)0x38, (byte)0x4d, (byte)0x27, (byte)0xd1, 
		(byte)0x09, (byte)0x19, (byte)0x77, (byte)0x91, (byte)0xa5, (byte)0x28, 
		(byte)0x33};
	
	public static final byte[] privateDBEncKey = { (byte) 0xf1, (byte) 0xc2,
		(byte) 0x68, (byte) 0x27, (byte) 0x9d, (byte) 0xaf, (byte) 0x29,
		(byte) 0x1d, (byte) 0x33, (byte) 0x4d, (byte) 0x0a, (byte) 0x2c,
		(byte) 0x83, (byte) 0xcc, (byte) 0xfd, (byte) 0xef };
	
	private static byte[] internal_iv = {113,119,101,97,115,100,122,120,99,114,102,118,116,103,98,121};
	
	public static int read = 0x10; //0x01 : aes only read, 0x10 : normal only read  
	public static int write = 0x10; //0x01 : aes only write, 0x10 : normal only write 0x11 : aes + normal write
	
	public static final int MODE_ECB	=	1 ;
	public static final int MODE_CBC	=	2 ;

	public static final int KEYBITS_128	=	128 ;
	public static final int KEYBITS_192	=	192 ;
	public static final int KEYBITS_256 = 256;


	public String getRead() {
		return Integer.toString(read, 16);
	}

	public void setRead(String input) {
		read = Integer.parseInt(input, 16);
	}

	public String getWrite() {
		return Integer.toString(write, 16);
	}

	public void setWrite(String input) {
		write = Integer.parseInt(input, 16);
	}	
	
	public void setAes_mode(String input){
		mode = Integer.parseInt(input, 10);
	}
	
	// TO NOT CALL!!!!
	public void setAes_key(String aesKey) {
		try {
			key = aesKey.getBytes("UTF-8");
		} catch (UnsupportedEncodingException e) {
			// TODO Auto-generated catch block
			//e.printStackTrace();
			key = new byte[]{(byte)0xf5, (byte)0x3a, (byte)0x88, 
					(byte)0x0a, (byte)0xdc, (byte)0x38, (byte)0x4d, (byte)0x27, (byte)0xd1, 
					(byte)0x09, (byte)0x19, (byte)0x77, (byte)0x91, (byte)0xa5, (byte)0x28, 
					(byte)0x33};
		}
		if(key.length >= 16){
			System.arraycopy(key, 0, internal_key, 0, 16);			
		}
		
		if(key.length >= 32){
			System.arraycopy(key, 16, internal_iv, 0, 16);
		}
	}
	
	 private static final int[] Te0 = {  
            (int)0xc66363a5, (int)0xf87c7c84, (int)0xee777799, (int)0xf67b7b8d,
            (int)0xfff2f20d, (int)0xd66b6bbd, (int)0xde6f6fb1, (int)0x91c5c554,
            (int)0x60303050, (int)0x02010103, (int)0xce6767a9, (int)0x562b2b7d,
            (int)0xe7fefe19, (int)0xb5d7d762, (int)0x4dababe6, (int)0xec76769a,
            (int)0x8fcaca45, (int)0x1f82829d, (int)0x89c9c940, (int)0xfa7d7d87,
            (int)0xeffafa15, (int)0xb25959eb, (int)0x8e4747c9, (int)0xfbf0f00b,
            (int)0x41adadec, (int)0xb3d4d467, (int)0x5fa2a2fd, (int)0x45afafea,
            (int)0x239c9cbf, (int)0x53a4a4f7, (int)0xe4727296, (int)0x9bc0c05b,
            (int)0x75b7b7c2, (int)0xe1fdfd1c, (int)0x3d9393ae, (int)0x4c26266a,
            (int)0x6c36365a, (int)0x7e3f3f41, (int)0xf5f7f702, (int)0x83cccc4f,
            (int)0x6834345c, (int)0x51a5a5f4, (int)0xd1e5e534, (int)0xf9f1f108,
            (int)0xe2717193, (int)0xabd8d873, (int)0x62313153, (int)0x2a15153f,
            (int)0x0804040c, (int)0x95c7c752, (int)0x46232365, (int)0x9dc3c35e,
            (int)0x30181828, (int)0x379696a1, (int)0x0a05050f, (int)0x2f9a9ab5,
            (int)0x0e070709, (int)0x24121236, (int)0x1b80809b, (int)0xdfe2e23d,
            (int)0xcdebeb26, (int)0x4e272769, (int)0x7fb2b2cd, (int)0xea75759f,
            (int)0x1209091b, (int)0x1d83839e, (int)0x582c2c74, (int)0x341a1a2e,
            (int)0x361b1b2d, (int)0xdc6e6eb2, (int)0xb45a5aee, (int)0x5ba0a0fb,
            (int)0xa45252f6, (int)0x763b3b4d, (int)0xb7d6d661, (int)0x7db3b3ce,
            (int)0x5229297b, (int)0xdde3e33e, (int)0x5e2f2f71, (int)0x13848497,
            (int)0xa65353f5, (int)0xb9d1d168, (int)0x00000000, (int)0xc1eded2c,
            (int)0x40202060, (int)0xe3fcfc1f, (int)0x79b1b1c8, (int)0xb65b5bed,
            (int)0xd46a6abe, (int)0x8dcbcb46, (int)0x67bebed9, (int)0x7239394b,
            (int)0x944a4ade, (int)0x984c4cd4, (int)0xb05858e8, (int)0x85cfcf4a,
            (int)0xbbd0d06b, (int)0xc5efef2a, (int)0x4faaaae5, (int)0xedfbfb16,
            (int)0x864343c5, (int)0x9a4d4dd7, (int)0x66333355, (int)0x11858594,
            (int)0x8a4545cf, (int)0xe9f9f910, (int)0x04020206, (int)0xfe7f7f81,
            (int)0xa05050f0, (int)0x783c3c44, (int)0x259f9fba, (int)0x4ba8a8e3,
            (int)0xa25151f3, (int)0x5da3a3fe, (int)0x804040c0, (int)0x058f8f8a,
            (int)0x3f9292ad, (int)0x219d9dbc, (int)0x70383848, (int)0xf1f5f504,
            (int)0x63bcbcdf, (int)0x77b6b6c1, (int)0xafdada75, (int)0x42212163,
            (int)0x20101030, (int)0xe5ffff1a, (int)0xfdf3f30e, (int)0xbfd2d26d,
            (int)0x81cdcd4c, (int)0x180c0c14, (int)0x26131335, (int)0xc3ecec2f,
            (int)0xbe5f5fe1, (int)0x359797a2, (int)0x884444cc, (int)0x2e171739,
            (int)0x93c4c457, (int)0x55a7a7f2, (int)0xfc7e7e82, (int)0x7a3d3d47,
            (int)0xc86464ac, (int)0xba5d5de7, (int)0x3219192b, (int)0xe6737395,
            (int)0xc06060a0, (int)0x19818198, (int)0x9e4f4fd1, (int)0xa3dcdc7f,
            (int)0x44222266, (int)0x542a2a7e, (int)0x3b9090ab, (int)0x0b888883,
            (int)0x8c4646ca, (int)0xc7eeee29, (int)0x6bb8b8d3, (int)0x2814143c,
            (int)0xa7dede79, (int)0xbc5e5ee2, (int)0x160b0b1d, (int)0xaddbdb76,
            (int)0xdbe0e03b, (int)0x64323256, (int)0x743a3a4e, (int)0x140a0a1e,
            (int)0x924949db, (int)0x0c06060a, (int)0x4824246c, (int)0xb85c5ce4,
            (int)0x9fc2c25d, (int)0xbdd3d36e, (int)0x43acacef, (int)0xc46262a6,
            (int)0x399191a8, (int)0x319595a4, (int)0xd3e4e437, (int)0xf279798b,
            (int)0xd5e7e732, (int)0x8bc8c843, (int)0x6e373759, (int)0xda6d6db7,
            (int)0x018d8d8c, (int)0xb1d5d564, (int)0x9c4e4ed2, (int)0x49a9a9e0,
            (int)0xd86c6cb4, (int)0xac5656fa, (int)0xf3f4f407, (int)0xcfeaea25,
            (int)0xca6565af, (int)0xf47a7a8e, (int)0x47aeaee9, (int)0x10080818,
            (int)0x6fbabad5, (int)0xf0787888, (int)0x4a25256f, (int)0x5c2e2e72,
            (int)0x381c1c24, (int)0x57a6a6f1, (int)0x73b4b4c7, (int)0x97c6c651,
            (int)0xcbe8e823, (int)0xa1dddd7c, (int)0xe874749c, (int)0x3e1f1f21,
            (int)0x964b4bdd, (int)0x61bdbddc, (int)0x0d8b8b86, (int)0x0f8a8a85,
            (int)0xe0707090, (int)0x7c3e3e42, (int)0x71b5b5c4, (int)0xcc6666aa,
            (int)0x904848d8, (int)0x06030305, (int)0xf7f6f601, (int)0x1c0e0e12,
            (int)0xc26161a3, (int)0x6a35355f, (int)0xae5757f9, (int)0x69b9b9d0,
            (int)0x17868691, (int)0x99c1c158, (int)0x3a1d1d27, (int)0x279e9eb9,
            (int)0xd9e1e138, (int)0xebf8f813, (int)0x2b9898b3, (int)0x22111133,
            (int)0xd26969bb, (int)0xa9d9d970, (int)0x078e8e89, (int)0x339494a7,
            (int)0x2d9b9bb6, (int)0x3c1e1e22, (int)0x15878792, (int)0xc9e9e920,
            (int)0x87cece49, (int)0xaa5555ff, (int)0x50282878, (int)0xa5dfdf7a,
            (int)0x038c8c8f, (int)0x59a1a1f8, (int)0x09898980, (int)0x1a0d0d17,
            (int)0x65bfbfda, (int)0xd7e6e631, (int)0x844242c6, (int)0xd06868b8,
            (int)0x824141c3, (int)0x299999b0, (int)0x5a2d2d77, (int)0x1e0f0f11,
            (int)0x7bb0b0cb, (int)0xa85454fc, (int)0x6dbbbbd6, (int)0x2c16163a,
        };

	 private static final int[] Te1 ={
            (int)0xa5c66363, (int)0x84f87c7c, (int)0x99ee7777, (int)0x8df67b7b,
            (int)0x0dfff2f2, (int)0xbdd66b6b, (int)0xb1de6f6f, (int)0x5491c5c5,
            (int)0x50603030, (int)0x03020101, (int)0xa9ce6767, (int)0x7d562b2b,
            (int)0x19e7fefe, (int)0x62b5d7d7, (int)0xe64dabab, (int)0x9aec7676,
            (int)0x458fcaca, (int)0x9d1f8282, (int)0x4089c9c9, (int)0x87fa7d7d,
            (int)0x15effafa, (int)0xebb25959, (int)0xc98e4747, (int)0x0bfbf0f0,
            (int)0xec41adad, (int)0x67b3d4d4, (int)0xfd5fa2a2, (int)0xea45afaf,
            (int)0xbf239c9c, (int)0xf753a4a4, (int)0x96e47272, (int)0x5b9bc0c0,
            (int)0xc275b7b7, (int)0x1ce1fdfd, (int)0xae3d9393, (int)0x6a4c2626,
            (int)0x5a6c3636, (int)0x417e3f3f, (int)0x02f5f7f7, (int)0x4f83cccc,
            (int)0x5c683434, (int)0xf451a5a5, (int)0x34d1e5e5, (int)0x08f9f1f1,
            (int)0x93e27171, (int)0x73abd8d8, (int)0x53623131, (int)0x3f2a1515,
            (int)0x0c080404, (int)0x5295c7c7, (int)0x65462323, (int)0x5e9dc3c3,
            (int)0x28301818, (int)0xa1379696, (int)0x0f0a0505, (int)0xb52f9a9a,
            (int)0x090e0707, (int)0x36241212, (int)0x9b1b8080, (int)0x3ddfe2e2,
            (int)0x26cdebeb, (int)0x694e2727, (int)0xcd7fb2b2, (int)0x9fea7575,
            (int)0x1b120909, (int)0x9e1d8383, (int)0x74582c2c, (int)0x2e341a1a,
            (int)0x2d361b1b, (int)0xb2dc6e6e, (int)0xeeb45a5a, (int)0xfb5ba0a0,
            (int)0xf6a45252, (int)0x4d763b3b, (int)0x61b7d6d6, (int)0xce7db3b3,
            (int)0x7b522929, (int)0x3edde3e3, (int)0x715e2f2f, (int)0x97138484,
            (int)0xf5a65353, (int)0x68b9d1d1, (int)0x00000000, (int)0x2cc1eded,
            (int)0x60402020, (int)0x1fe3fcfc, (int)0xc879b1b1, (int)0xedb65b5b,
            (int)0xbed46a6a, (int)0x468dcbcb, (int)0xd967bebe, (int)0x4b723939,
            (int)0xde944a4a, (int)0xd4984c4c, (int)0xe8b05858, (int)0x4a85cfcf,
            (int)0x6bbbd0d0, (int)0x2ac5efef, (int)0xe54faaaa, (int)0x16edfbfb,
            (int)0xc5864343, (int)0xd79a4d4d, (int)0x55663333, (int)0x94118585,
            (int)0xcf8a4545, (int)0x10e9f9f9, (int)0x06040202, (int)0x81fe7f7f,
            (int)0xf0a05050, (int)0x44783c3c, (int)0xba259f9f, (int)0xe34ba8a8,
            (int)0xf3a25151, (int)0xfe5da3a3, (int)0xc0804040, (int)0x8a058f8f,
            (int)0xad3f9292, (int)0xbc219d9d, (int)0x48703838, (int)0x04f1f5f5,
            (int)0xdf63bcbc, (int)0xc177b6b6, (int)0x75afdada, (int)0x63422121,
            (int)0x30201010, (int)0x1ae5ffff, (int)0x0efdf3f3, (int)0x6dbfd2d2,
            (int)0x4c81cdcd, (int)0x14180c0c, (int)0x35261313, (int)0x2fc3ecec,
            (int)0xe1be5f5f, (int)0xa2359797, (int)0xcc884444, (int)0x392e1717,
            (int)0x5793c4c4, (int)0xf255a7a7, (int)0x82fc7e7e, (int)0x477a3d3d,
            (int)0xacc86464, (int)0xe7ba5d5d, (int)0x2b321919, (int)0x95e67373,
            (int)0xa0c06060, (int)0x98198181, (int)0xd19e4f4f, (int)0x7fa3dcdc,
            (int)0x66442222, (int)0x7e542a2a, (int)0xab3b9090, (int)0x830b8888,
            (int)0xca8c4646, (int)0x29c7eeee, (int)0xd36bb8b8, (int)0x3c281414,
            (int)0x79a7dede, (int)0xe2bc5e5e, (int)0x1d160b0b, (int)0x76addbdb,
            (int)0x3bdbe0e0, (int)0x56643232, (int)0x4e743a3a, (int)0x1e140a0a,
            (int)0xdb924949, (int)0x0a0c0606, (int)0x6c482424, (int)0xe4b85c5c,
            (int)0x5d9fc2c2, (int)0x6ebdd3d3, (int)0xef43acac, (int)0xa6c46262,
            (int)0xa8399191, (int)0xa4319595, (int)0x37d3e4e4, (int)0x8bf27979,
            (int)0x32d5e7e7, (int)0x438bc8c8, (int)0x596e3737, (int)0xb7da6d6d,
            (int)0x8c018d8d, (int)0x64b1d5d5, (int)0xd29c4e4e, (int)0xe049a9a9,
            (int)0xb4d86c6c, (int)0xfaac5656, (int)0x07f3f4f4, (int)0x25cfeaea,
            (int)0xafca6565, (int)0x8ef47a7a, (int)0xe947aeae, (int)0x18100808,
            (int)0xd56fbaba, (int)0x88f07878, (int)0x6f4a2525, (int)0x725c2e2e,
            (int)0x24381c1c, (int)0xf157a6a6, (int)0xc773b4b4, (int)0x5197c6c6,
            (int)0x23cbe8e8, (int)0x7ca1dddd, (int)0x9ce87474, (int)0x213e1f1f,
            (int)0xdd964b4b, (int)0xdc61bdbd, (int)0x860d8b8b, (int)0x850f8a8a,
            (int)0x90e07070, (int)0x427c3e3e, (int)0xc471b5b5, (int)0xaacc6666,
            (int)0xd8904848, (int)0x05060303, (int)0x01f7f6f6, (int)0x121c0e0e,
            (int)0xa3c26161, (int)0x5f6a3535, (int)0xf9ae5757, (int)0xd069b9b9,
            (int)0x91178686, (int)0x5899c1c1, (int)0x273a1d1d, (int)0xb9279e9e,
            (int)0x38d9e1e1, (int)0x13ebf8f8, (int)0xb32b9898, (int)0x33221111,
            (int)0xbbd26969, (int)0x70a9d9d9, (int)0x89078e8e, (int)0xa7339494,
            (int)0xb62d9b9b, (int)0x223c1e1e, (int)0x92158787, (int)0x20c9e9e9,
            (int)0x4987cece, (int)0xffaa5555, (int)0x78502828, (int)0x7aa5dfdf,
            (int)0x8f038c8c, (int)0xf859a1a1, (int)0x80098989, (int)0x171a0d0d,
            (int)0xda65bfbf, (int)0x31d7e6e6, (int)0xc6844242, (int)0xb8d06868,
            (int)0xc3824141, (int)0xb0299999, (int)0x775a2d2d, (int)0x111e0f0f,
            (int)0xcb7bb0b0, (int)0xfca85454, (int)0xd66dbbbb, (int)0x3a2c1616,
        };

	 private static final int[] Te2 = {
            (int)0x63a5c663, (int)0x7c84f87c, (int)0x7799ee77, (int)0x7b8df67b,
            (int)0xf20dfff2, (int)0x6bbdd66b, (int)0x6fb1de6f, (int)0xc55491c5,
            (int)0x30506030, (int)0x01030201, (int)0x67a9ce67, (int)0x2b7d562b,
            (int)0xfe19e7fe, (int)0xd762b5d7, (int)0xabe64dab, (int)0x769aec76,
            (int)0xca458fca, (int)0x829d1f82, (int)0xc94089c9, (int)0x7d87fa7d,
            (int)0xfa15effa, (int)0x59ebb259, (int)0x47c98e47, (int)0xf00bfbf0,
            (int)0xadec41ad, (int)0xd467b3d4, (int)0xa2fd5fa2, (int)0xafea45af,
            (int)0x9cbf239c, (int)0xa4f753a4, (int)0x7296e472, (int)0xc05b9bc0,
            (int)0xb7c275b7, (int)0xfd1ce1fd, (int)0x93ae3d93, (int)0x266a4c26,
            (int)0x365a6c36, (int)0x3f417e3f, (int)0xf702f5f7, (int)0xcc4f83cc,
            (int)0x345c6834, (int)0xa5f451a5, (int)0xe534d1e5, (int)0xf108f9f1,
            (int)0x7193e271, (int)0xd873abd8, (int)0x31536231, (int)0x153f2a15,
            (int)0x040c0804, (int)0xc75295c7, (int)0x23654623, (int)0xc35e9dc3,
            (int)0x18283018, (int)0x96a13796, (int)0x050f0a05, (int)0x9ab52f9a,
            (int)0x07090e07, (int)0x12362412, (int)0x809b1b80, (int)0xe23ddfe2,
            (int)0xeb26cdeb, (int)0x27694e27, (int)0xb2cd7fb2, (int)0x759fea75,
            (int)0x091b1209, (int)0x839e1d83, (int)0x2c74582c, (int)0x1a2e341a,
            (int)0x1b2d361b, (int)0x6eb2dc6e, (int)0x5aeeb45a, (int)0xa0fb5ba0,
            (int)0x52f6a452, (int)0x3b4d763b, (int)0xd661b7d6, (int)0xb3ce7db3,
            (int)0x297b5229, (int)0xe33edde3, (int)0x2f715e2f, (int)0x84971384,
            (int)0x53f5a653, (int)0xd168b9d1, (int)0x00000000, (int)0xed2cc1ed,
            (int)0x20604020, (int)0xfc1fe3fc, (int)0xb1c879b1, (int)0x5bedb65b,
            (int)0x6abed46a, (int)0xcb468dcb, (int)0xbed967be, (int)0x394b7239,
            (int)0x4ade944a, (int)0x4cd4984c, (int)0x58e8b058, (int)0xcf4a85cf,
            (int)0xd06bbbd0, (int)0xef2ac5ef, (int)0xaae54faa, (int)0xfb16edfb,
            (int)0x43c58643, (int)0x4dd79a4d, (int)0x33556633, (int)0x85941185,
            (int)0x45cf8a45, (int)0xf910e9f9, (int)0x02060402, (int)0x7f81fe7f,
            (int)0x50f0a050, (int)0x3c44783c, (int)0x9fba259f, (int)0xa8e34ba8,
            (int)0x51f3a251, (int)0xa3fe5da3, (int)0x40c08040, (int)0x8f8a058f,
            (int)0x92ad3f92, (int)0x9dbc219d, (int)0x38487038, (int)0xf504f1f5,
            (int)0xbcdf63bc, (int)0xb6c177b6, (int)0xda75afda, (int)0x21634221,
            (int)0x10302010, (int)0xff1ae5ff, (int)0xf30efdf3, (int)0xd26dbfd2,
            (int)0xcd4c81cd, (int)0x0c14180c, (int)0x13352613, (int)0xec2fc3ec,
            (int)0x5fe1be5f, (int)0x97a23597, (int)0x44cc8844, (int)0x17392e17,
            (int)0xc45793c4, (int)0xa7f255a7, (int)0x7e82fc7e, (int)0x3d477a3d,
            (int)0x64acc864, (int)0x5de7ba5d, (int)0x192b3219, (int)0x7395e673,
            (int)0x60a0c060, (int)0x81981981, (int)0x4fd19e4f, (int)0xdc7fa3dc,
            (int)0x22664422, (int)0x2a7e542a, (int)0x90ab3b90, (int)0x88830b88,
            (int)0x46ca8c46, (int)0xee29c7ee, (int)0xb8d36bb8, (int)0x143c2814,
            (int)0xde79a7de, (int)0x5ee2bc5e, (int)0x0b1d160b, (int)0xdb76addb,
            (int)0xe03bdbe0, (int)0x32566432, (int)0x3a4e743a, (int)0x0a1e140a,
            (int)0x49db9249, (int)0x060a0c06, (int)0x246c4824, (int)0x5ce4b85c,
            (int)0xc25d9fc2, (int)0xd36ebdd3, (int)0xacef43ac, (int)0x62a6c462,
            (int)0x91a83991, (int)0x95a43195, (int)0xe437d3e4, (int)0x798bf279,
            (int)0xe732d5e7, (int)0xc8438bc8, (int)0x37596e37, (int)0x6db7da6d,
            (int)0x8d8c018d, (int)0xd564b1d5, (int)0x4ed29c4e, (int)0xa9e049a9,
            (int)0x6cb4d86c, (int)0x56faac56, (int)0xf407f3f4, (int)0xea25cfea,
            (int)0x65afca65, (int)0x7a8ef47a, (int)0xaee947ae, (int)0x08181008,
            (int)0xbad56fba, (int)0x7888f078, (int)0x256f4a25, (int)0x2e725c2e,
            (int)0x1c24381c, (int)0xa6f157a6, (int)0xb4c773b4, (int)0xc65197c6,
            (int)0xe823cbe8, (int)0xdd7ca1dd, (int)0x749ce874, (int)0x1f213e1f,
            (int)0x4bdd964b, (int)0xbddc61bd, (int)0x8b860d8b, (int)0x8a850f8a,
            (int)0x7090e070, (int)0x3e427c3e, (int)0xb5c471b5, (int)0x66aacc66,
            (int)0x48d89048, (int)0x03050603, (int)0xf601f7f6, (int)0x0e121c0e,
            (int)0x61a3c261, (int)0x355f6a35, (int)0x57f9ae57, (int)0xb9d069b9,
            (int)0x86911786, (int)0xc15899c1, (int)0x1d273a1d, (int)0x9eb9279e,
            (int)0xe138d9e1, (int)0xf813ebf8, (int)0x98b32b98, (int)0x11332211,
            (int)0x69bbd269, (int)0xd970a9d9, (int)0x8e89078e, (int)0x94a73394,
            (int)0x9bb62d9b, (int)0x1e223c1e, (int)0x87921587, (int)0xe920c9e9,
            (int)0xce4987ce, (int)0x55ffaa55, (int)0x28785028, (int)0xdf7aa5df,
            (int)0x8c8f038c, (int)0xa1f859a1, (int)0x89800989, (int)0x0d171a0d,
            (int)0xbfda65bf, (int)0xe631d7e6, (int)0x42c68442, (int)0x68b8d068,
            (int)0x41c38241, (int)0x99b02999, (int)0x2d775a2d, (int)0x0f111e0f,
            (int)0xb0cb7bb0, (int)0x54fca854, (int)0xbbd66dbb, (int)0x163a2c16,
        };

	 private static final int[] Te3 = {
            (int)0x6363a5c6, (int)0x7c7c84f8, (int)0x777799ee, (int)0x7b7b8df6,
            (int)0xf2f20dff, (int)0x6b6bbdd6, (int)0x6f6fb1de, (int)0xc5c55491,
            (int)0x30305060, (int)0x01010302, (int)0x6767a9ce, (int)0x2b2b7d56,
            (int)0xfefe19e7, (int)0xd7d762b5, (int)0xababe64d, (int)0x76769aec,
            (int)0xcaca458f, (int)0x82829d1f, (int)0xc9c94089, (int)0x7d7d87fa,
            (int)0xfafa15ef, (int)0x5959ebb2, (int)0x4747c98e, (int)0xf0f00bfb,
            (int)0xadadec41, (int)0xd4d467b3, (int)0xa2a2fd5f, (int)0xafafea45,
            (int)0x9c9cbf23, (int)0xa4a4f753, (int)0x727296e4, (int)0xc0c05b9b,
            (int)0xb7b7c275, (int)0xfdfd1ce1, (int)0x9393ae3d, (int)0x26266a4c,
            (int)0x36365a6c, (int)0x3f3f417e, (int)0xf7f702f5, (int)0xcccc4f83,
            (int)0x34345c68, (int)0xa5a5f451, (int)0xe5e534d1, (int)0xf1f108f9,
            (int)0x717193e2, (int)0xd8d873ab, (int)0x31315362, (int)0x15153f2a,
            (int)0x04040c08, (int)0xc7c75295, (int)0x23236546, (int)0xc3c35e9d,
            (int)0x18182830, (int)0x9696a137, (int)0x05050f0a, (int)0x9a9ab52f,
            (int)0x0707090e, (int)0x12123624, (int)0x80809b1b, (int)0xe2e23ddf,
            (int)0xebeb26cd, (int)0x2727694e, (int)0xb2b2cd7f, (int)0x75759fea,
            (int)0x09091b12, (int)0x83839e1d, (int)0x2c2c7458, (int)0x1a1a2e34,
            (int)0x1b1b2d36, (int)0x6e6eb2dc, (int)0x5a5aeeb4, (int)0xa0a0fb5b,
            (int)0x5252f6a4, (int)0x3b3b4d76, (int)0xd6d661b7, (int)0xb3b3ce7d,
            (int)0x29297b52, (int)0xe3e33edd, (int)0x2f2f715e, (int)0x84849713,
            (int)0x5353f5a6, (int)0xd1d168b9, (int)0x00000000, (int)0xeded2cc1,
            (int)0x20206040, (int)0xfcfc1fe3, (int)0xb1b1c879, (int)0x5b5bedb6,
            (int)0x6a6abed4, (int)0xcbcb468d, (int)0xbebed967, (int)0x39394b72,
            (int)0x4a4ade94, (int)0x4c4cd498, (int)0x5858e8b0, (int)0xcfcf4a85,
            (int)0xd0d06bbb, (int)0xefef2ac5, (int)0xaaaae54f, (int)0xfbfb16ed,
            (int)0x4343c586, (int)0x4d4dd79a, (int)0x33335566, (int)0x85859411,
            (int)0x4545cf8a, (int)0xf9f910e9, (int)0x02020604, (int)0x7f7f81fe,
            (int)0x5050f0a0, (int)0x3c3c4478, (int)0x9f9fba25, (int)0xa8a8e34b,
            (int)0x5151f3a2, (int)0xa3a3fe5d, (int)0x4040c080, (int)0x8f8f8a05,
            (int)0x9292ad3f, (int)0x9d9dbc21, (int)0x38384870, (int)0xf5f504f1,
            (int)0xbcbcdf63, (int)0xb6b6c177, (int)0xdada75af, (int)0x21216342,
            (int)0x10103020, (int)0xffff1ae5, (int)0xf3f30efd, (int)0xd2d26dbf,
            (int)0xcdcd4c81, (int)0x0c0c1418, (int)0x13133526, (int)0xecec2fc3,
            (int)0x5f5fe1be, (int)0x9797a235, (int)0x4444cc88, (int)0x1717392e,
            (int)0xc4c45793, (int)0xa7a7f255, (int)0x7e7e82fc, (int)0x3d3d477a,
            (int)0x6464acc8, (int)0x5d5de7ba, (int)0x19192b32, (int)0x737395e6,
            (int)0x6060a0c0, (int)0x81819819, (int)0x4f4fd19e, (int)0xdcdc7fa3,
            (int)0x22226644, (int)0x2a2a7e54, (int)0x9090ab3b, (int)0x8888830b,
            (int)0x4646ca8c, (int)0xeeee29c7, (int)0xb8b8d36b, (int)0x14143c28,
            (int)0xdede79a7, (int)0x5e5ee2bc, (int)0x0b0b1d16, (int)0xdbdb76ad,
            (int)0xe0e03bdb, (int)0x32325664, (int)0x3a3a4e74, (int)0x0a0a1e14,
            (int)0x4949db92, (int)0x06060a0c, (int)0x24246c48, (int)0x5c5ce4b8,
            (int)0xc2c25d9f, (int)0xd3d36ebd, (int)0xacacef43, (int)0x6262a6c4,
            (int)0x9191a839, (int)0x9595a431, (int)0xe4e437d3, (int)0x79798bf2,
            (int)0xe7e732d5, (int)0xc8c8438b, (int)0x3737596e, (int)0x6d6db7da,
            (int)0x8d8d8c01, (int)0xd5d564b1, (int)0x4e4ed29c, (int)0xa9a9e049,
            (int)0x6c6cb4d8, (int)0x5656faac, (int)0xf4f407f3, (int)0xeaea25cf,
            (int)0x6565afca, (int)0x7a7a8ef4, (int)0xaeaee947, (int)0x08081810,
            (int)0xbabad56f, (int)0x787888f0, (int)0x25256f4a, (int)0x2e2e725c,
            (int)0x1c1c2438, (int)0xa6a6f157, (int)0xb4b4c773, (int)0xc6c65197,
            (int)0xe8e823cb, (int)0xdddd7ca1, (int)0x74749ce8, (int)0x1f1f213e,
            (int)0x4b4bdd96, (int)0xbdbddc61, (int)0x8b8b860d, (int)0x8a8a850f,
            (int)0x707090e0, (int)0x3e3e427c, (int)0xb5b5c471, (int)0x6666aacc,
            (int)0x4848d890, (int)0x03030506, (int)0xf6f601f7, (int)0x0e0e121c,
            (int)0x6161a3c2, (int)0x35355f6a, (int)0x5757f9ae, (int)0xb9b9d069,
            (int)0x86869117, (int)0xc1c15899, (int)0x1d1d273a, (int)0x9e9eb927,
            (int)0xe1e138d9, (int)0xf8f813eb, (int)0x9898b32b, (int)0x11113322,
            (int)0x6969bbd2, (int)0xd9d970a9, (int)0x8e8e8907, (int)0x9494a733,
            (int)0x9b9bb62d, (int)0x1e1e223c, (int)0x87879215, (int)0xe9e920c9,
            (int)0xcece4987, (int)0x5555ffaa, (int)0x28287850, (int)0xdfdf7aa5,
            (int)0x8c8c8f03, (int)0xa1a1f859, (int)0x89898009, (int)0x0d0d171a,
            (int)0xbfbfda65, (int)0xe6e631d7, (int)0x4242c684, (int)0x6868b8d0,
            (int)0x4141c382, (int)0x9999b029, (int)0x2d2d775a, (int)0x0f0f111e,
            (int)0xb0b0cb7b, (int)0x5454fca8, (int)0xbbbbd66d, (int)0x16163a2c,
        };

	 private static final int[] Te4 = {
            (int)0x63636363, (int)0x7c7c7c7c, (int)0x77777777, (int)0x7b7b7b7b,
            (int)0xf2f2f2f2, (int)0x6b6b6b6b, (int)0x6f6f6f6f, (int)0xc5c5c5c5,
            (int)0x30303030, (int)0x01010101, (int)0x67676767, (int)0x2b2b2b2b,
            (int)0xfefefefe, (int)0xd7d7d7d7, (int)0xabababab, (int)0x76767676,
            (int)0xcacacaca, (int)0x82828282, (int)0xc9c9c9c9, (int)0x7d7d7d7d,
            (int)0xfafafafa, (int)0x59595959, (int)0x47474747, (int)0xf0f0f0f0,
            (int)0xadadadad, (int)0xd4d4d4d4, (int)0xa2a2a2a2, (int)0xafafafaf,
            (int)0x9c9c9c9c, (int)0xa4a4a4a4, (int)0x72727272, (int)0xc0c0c0c0,
            (int)0xb7b7b7b7, (int)0xfdfdfdfd, (int)0x93939393, (int)0x26262626,
            (int)0x36363636, (int)0x3f3f3f3f, (int)0xf7f7f7f7, (int)0xcccccccc,
            (int)0x34343434, (int)0xa5a5a5a5, (int)0xe5e5e5e5, (int)0xf1f1f1f1,
            (int)0x71717171, (int)0xd8d8d8d8, (int)0x31313131, (int)0x15151515,
            (int)0x04040404, (int)0xc7c7c7c7, (int)0x23232323, (int)0xc3c3c3c3,
            (int)0x18181818, (int)0x96969696, (int)0x05050505, (int)0x9a9a9a9a,
            (int)0x07070707, (int)0x12121212, (int)0x80808080, (int)0xe2e2e2e2,
            (int)0xebebebeb, (int)0x27272727, (int)0xb2b2b2b2, (int)0x75757575,
            (int)0x09090909, (int)0x83838383, (int)0x2c2c2c2c, (int)0x1a1a1a1a,
            (int)0x1b1b1b1b, (int)0x6e6e6e6e, (int)0x5a5a5a5a, (int)0xa0a0a0a0,
            (int)0x52525252, (int)0x3b3b3b3b, (int)0xd6d6d6d6, (int)0xb3b3b3b3,
            (int)0x29292929, (int)0xe3e3e3e3, (int)0x2f2f2f2f, (int)0x84848484,
            (int)0x53535353, (int)0xd1d1d1d1, (int)0x00000000, (int)0xedededed,
            (int)0x20202020, (int)0xfcfcfcfc, (int)0xb1b1b1b1, (int)0x5b5b5b5b,
            (int)0x6a6a6a6a, (int)0xcbcbcbcb, (int)0xbebebebe, (int)0x39393939,
            (int)0x4a4a4a4a, (int)0x4c4c4c4c, (int)0x58585858, (int)0xcfcfcfcf,
            (int)0xd0d0d0d0, (int)0xefefefef, (int)0xaaaaaaaa, (int)0xfbfbfbfb,
            (int)0x43434343, (int)0x4d4d4d4d, (int)0x33333333, (int)0x85858585,
            (int)0x45454545, (int)0xf9f9f9f9, (int)0x02020202, (int)0x7f7f7f7f,
            (int)0x50505050, (int)0x3c3c3c3c, (int)0x9f9f9f9f, (int)0xa8a8a8a8,
            (int)0x51515151, (int)0xa3a3a3a3, (int)0x40404040, (int)0x8f8f8f8f,
            (int)0x92929292, (int)0x9d9d9d9d, (int)0x38383838, (int)0xf5f5f5f5,
            (int)0xbcbcbcbc, (int)0xb6b6b6b6, (int)0xdadadada, (int)0x21212121,
            (int)0x10101010, (int)0xffffffff, (int)0xf3f3f3f3, (int)0xd2d2d2d2,
            (int)0xcdcdcdcd, (int)0x0c0c0c0c, (int)0x13131313, (int)0xecececec,
            (int)0x5f5f5f5f, (int)0x97979797, (int)0x44444444, (int)0x17171717,
            (int)0xc4c4c4c4, (int)0xa7a7a7a7, (int)0x7e7e7e7e, (int)0x3d3d3d3d,
            (int)0x64646464, (int)0x5d5d5d5d, (int)0x19191919, (int)0x73737373,
            (int)0x60606060, (int)0x81818181, (int)0x4f4f4f4f, (int)0xdcdcdcdc,
            (int)0x22222222, (int)0x2a2a2a2a, (int)0x90909090, (int)0x88888888,
            (int)0x46464646, (int)0xeeeeeeee, (int)0xb8b8b8b8, (int)0x14141414,
            (int)0xdededede, (int)0x5e5e5e5e, (int)0x0b0b0b0b, (int)0xdbdbdbdb,
            (int)0xe0e0e0e0, (int)0x32323232, (int)0x3a3a3a3a, (int)0x0a0a0a0a,
            (int)0x49494949, (int)0x06060606, (int)0x24242424, (int)0x5c5c5c5c,
            (int)0xc2c2c2c2, (int)0xd3d3d3d3, (int)0xacacacac, (int)0x62626262,
            (int)0x91919191, (int)0x95959595, (int)0xe4e4e4e4, (int)0x79797979,
            (int)0xe7e7e7e7, (int)0xc8c8c8c8, (int)0x37373737, (int)0x6d6d6d6d,
            (int)0x8d8d8d8d, (int)0xd5d5d5d5, (int)0x4e4e4e4e, (int)0xa9a9a9a9,
            (int)0x6c6c6c6c, (int)0x56565656, (int)0xf4f4f4f4, (int)0xeaeaeaea,
            (int)0x65656565, (int)0x7a7a7a7a, (int)0xaeaeaeae, (int)0x08080808,
            (int)0xbabababa, (int)0x78787878, (int)0x25252525, (int)0x2e2e2e2e,
            (int)0x1c1c1c1c, (int)0xa6a6a6a6, (int)0xb4b4b4b4, (int)0xc6c6c6c6,
            (int)0xe8e8e8e8, (int)0xdddddddd, (int)0x74747474, (int)0x1f1f1f1f,
            (int)0x4b4b4b4b, (int)0xbdbdbdbd, (int)0x8b8b8b8b, (int)0x8a8a8a8a,
            (int)0x70707070, (int)0x3e3e3e3e, (int)0xb5b5b5b5, (int)0x66666666,
            (int)0x48484848, (int)0x03030303, (int)0xf6f6f6f6, (int)0x0e0e0e0e,
            (int)0x61616161, (int)0x35353535, (int)0x57575757, (int)0xb9b9b9b9,
            (int)0x86868686, (int)0xc1c1c1c1, (int)0x1d1d1d1d, (int)0x9e9e9e9e,
            (int)0xe1e1e1e1, (int)0xf8f8f8f8, (int)0x98989898, (int)0x11111111,
            (int)0x69696969, (int)0xd9d9d9d9, (int)0x8e8e8e8e, (int)0x94949494,
            (int)0x9b9b9b9b, (int)0x1e1e1e1e, (int)0x87878787, (int)0xe9e9e9e9,
            (int)0xcececece, (int)0x55555555, (int)0x28282828, (int)0xdfdfdfdf,
            (int)0x8c8c8c8c, (int)0xa1a1a1a1, (int)0x89898989, (int)0x0d0d0d0d,
            (int)0xbfbfbfbf, (int)0xe6e6e6e6, (int)0x42424242, (int)0x68686868,
            (int)0x41414141, (int)0x99999999, (int)0x2d2d2d2d, (int)0x0f0f0f0f,
            (int)0xb0b0b0b0, (int)0x54545454, (int)0xbbbbbbbb, (int)0x16161616,
        };

	 private static final int[] Td0 = {
            (int)0x51f4a750, (int)0x7e416553, (int)0x1a17a4c3, (int)0x3a275e96,
            (int)0x3bab6bcb, (int)0x1f9d45f1, (int)0xacfa58ab, (int)0x4be30393,
            (int)0x2030fa55, (int)0xad766df6, (int)0x88cc7691, (int)0xf5024c25,
            (int)0x4fe5d7fc, (int)0xc52acbd7, (int)0x26354480, (int)0xb562a38f,
            (int)0xdeb15a49, (int)0x25ba1b67, (int)0x45ea0e98, (int)0x5dfec0e1,
            (int)0xc32f7502, (int)0x814cf012, (int)0x8d4697a3, (int)0x6bd3f9c6,
            (int)0x038f5fe7, (int)0x15929c95, (int)0xbf6d7aeb, (int)0x955259da,
            (int)0xd4be832d, (int)0x587421d3, (int)0x49e06929, (int)0x8ec9c844,
            (int)0x75c2896a, (int)0xf48e7978, (int)0x99583e6b, (int)0x27b971dd,
            (int)0xbee14fb6, (int)0xf088ad17, (int)0xc920ac66, (int)0x7dce3ab4,
            (int)0x63df4a18, (int)0xe51a3182, (int)0x97513360, (int)0x62537f45,
            (int)0xb16477e0, (int)0xbb6bae84, (int)0xfe81a01c, (int)0xf9082b94,
            (int)0x70486858, (int)0x8f45fd19, (int)0x94de6c87, (int)0x527bf8b7,
            (int)0xab73d323, (int)0x724b02e2, (int)0xe31f8f57, (int)0x6655ab2a,
            (int)0xb2eb2807, (int)0x2fb5c203, (int)0x86c57b9a, (int)0xd33708a5,
            (int)0x302887f2, (int)0x23bfa5b2, (int)0x02036aba, (int)0xed16825c,
            (int)0x8acf1c2b, (int)0xa779b492, (int)0xf307f2f0, (int)0x4e69e2a1,
            (int)0x65daf4cd, (int)0x0605bed5, (int)0xd134621f, (int)0xc4a6fe8a,
            (int)0x342e539d, (int)0xa2f355a0, (int)0x058ae132, (int)0xa4f6eb75,
            (int)0x0b83ec39, (int)0x4060efaa, (int)0x5e719f06, (int)0xbd6e1051,
            (int)0x3e218af9, (int)0x96dd063d, (int)0xdd3e05ae, (int)0x4de6bd46,
            (int)0x91548db5, (int)0x71c45d05, (int)0x0406d46f, (int)0x605015ff,
            (int)0x1998fb24, (int)0xd6bde997, (int)0x894043cc, (int)0x67d99e77,
            (int)0xb0e842bd, (int)0x07898b88, (int)0xe7195b38, (int)0x79c8eedb,
            (int)0xa17c0a47, (int)0x7c420fe9, (int)0xf8841ec9, (int)0x00000000,
            (int)0x09808683, (int)0x322bed48, (int)0x1e1170ac, (int)0x6c5a724e,
            (int)0xfd0efffb, (int)0x0f853856, (int)0x3daed51e, (int)0x362d3927,
            (int)0x0a0fd964, (int)0x685ca621, (int)0x9b5b54d1, (int)0x24362e3a,
            (int)0x0c0a67b1, (int)0x9357e70f, (int)0xb4ee96d2, (int)0x1b9b919e,
            (int)0x80c0c54f, (int)0x61dc20a2, (int)0x5a774b69, (int)0x1c121a16,
            (int)0xe293ba0a, (int)0xc0a02ae5, (int)0x3c22e043, (int)0x121b171d,
            (int)0x0e090d0b, (int)0xf28bc7ad, (int)0x2db6a8b9, (int)0x141ea9c8,
            (int)0x57f11985, (int)0xaf75074c, (int)0xee99ddbb, (int)0xa37f60fd,
            (int)0xf701269f, (int)0x5c72f5bc, (int)0x44663bc5, (int)0x5bfb7e34,
            (int)0x8b432976, (int)0xcb23c6dc, (int)0xb6edfc68, (int)0xb8e4f163,
            (int)0xd731dcca, (int)0x42638510, (int)0x13972240, (int)0x84c61120,
            (int)0x854a247d, (int)0xd2bb3df8, (int)0xaef93211, (int)0xc729a16d,
            (int)0x1d9e2f4b, (int)0xdcb230f3, (int)0x0d8652ec, (int)0x77c1e3d0,
            (int)0x2bb3166c, (int)0xa970b999, (int)0x119448fa, (int)0x47e96422,
            (int)0xa8fc8cc4, (int)0xa0f03f1a, (int)0x567d2cd8, (int)0x223390ef,
            (int)0x87494ec7, (int)0xd938d1c1, (int)0x8ccaa2fe, (int)0x98d40b36,
            (int)0xa6f581cf, (int)0xa57ade28, (int)0xdab78e26, (int)0x3fadbfa4,
            (int)0x2c3a9de4, (int)0x5078920d, (int)0x6a5fcc9b, (int)0x547e4662,
            (int)0xf68d13c2, (int)0x90d8b8e8, (int)0x2e39f75e, (int)0x82c3aff5,
            (int)0x9f5d80be, (int)0x69d0937c, (int)0x6fd52da9, (int)0xcf2512b3,
            (int)0xc8ac993b, (int)0x10187da7, (int)0xe89c636e, (int)0xdb3bbb7b,
            (int)0xcd267809, (int)0x6e5918f4, (int)0xec9ab701, (int)0x834f9aa8,
            (int)0xe6956e65, (int)0xaaffe67e, (int)0x21bccf08, (int)0xef15e8e6,
            (int)0xbae79bd9, (int)0x4a6f36ce, (int)0xea9f09d4, (int)0x29b07cd6,
            (int)0x31a4b2af, (int)0x2a3f2331, (int)0xc6a59430, (int)0x35a266c0,
            (int)0x744ebc37, (int)0xfc82caa6, (int)0xe090d0b0, (int)0x33a7d815,
            (int)0xf104984a, (int)0x41ecdaf7, (int)0x7fcd500e, (int)0x1791f62f,
            (int)0x764dd68d, (int)0x43efb04d, (int)0xccaa4d54, (int)0xe49604df,
            (int)0x9ed1b5e3, (int)0x4c6a881b, (int)0xc12c1fb8, (int)0x4665517f,
            (int)0x9d5eea04, (int)0x018c355d, (int)0xfa877473, (int)0xfb0b412e,
            (int)0xb3671d5a, (int)0x92dbd252, (int)0xe9105633, (int)0x6dd64713,
            (int)0x9ad7618c, (int)0x37a10c7a, (int)0x59f8148e, (int)0xeb133c89,
            (int)0xcea927ee, (int)0xb761c935, (int)0xe11ce5ed, (int)0x7a47b13c,
            (int)0x9cd2df59, (int)0x55f2733f, (int)0x1814ce79, (int)0x73c737bf,
            (int)0x53f7cdea, (int)0x5ffdaa5b, (int)0xdf3d6f14, (int)0x7844db86,
            (int)0xcaaff381, (int)0xb968c43e, (int)0x3824342c, (int)0xc2a3405f,
            (int)0x161dc372, (int)0xbce2250c, (int)0x283c498b, (int)0xff0d9541,
            (int)0x39a80171, (int)0x080cb3de, (int)0xd8b4e49c, (int)0x6456c190,
            (int)0x7bcb8461, (int)0xd532b670, (int)0x486c5c74, (int)0xd0b85742,
        };

	 private static final int[] Td1 = {
            (int)0x5051f4a7, (int)0x537e4165, (int)0xc31a17a4, (int)0x963a275e,
            (int)0xcb3bab6b, (int)0xf11f9d45, (int)0xabacfa58, (int)0x934be303,
            (int)0x552030fa, (int)0xf6ad766d, (int)0x9188cc76, (int)0x25f5024c,
            (int)0xfc4fe5d7, (int)0xd7c52acb, (int)0x80263544, (int)0x8fb562a3,
            (int)0x49deb15a, (int)0x6725ba1b, (int)0x9845ea0e, (int)0xe15dfec0,
            (int)0x02c32f75, (int)0x12814cf0, (int)0xa38d4697, (int)0xc66bd3f9,
            (int)0xe7038f5f, (int)0x9515929c, (int)0xebbf6d7a, (int)0xda955259,
            (int)0x2dd4be83, (int)0xd3587421, (int)0x2949e069, (int)0x448ec9c8,
            (int)0x6a75c289, (int)0x78f48e79, (int)0x6b99583e, (int)0xdd27b971,
            (int)0xb6bee14f, (int)0x17f088ad, (int)0x66c920ac, (int)0xb47dce3a,
            (int)0x1863df4a, (int)0x82e51a31, (int)0x60975133, (int)0x4562537f,
            (int)0xe0b16477, (int)0x84bb6bae, (int)0x1cfe81a0, (int)0x94f9082b,
            (int)0x58704868, (int)0x198f45fd, (int)0x8794de6c, (int)0xb7527bf8,
            (int)0x23ab73d3, (int)0xe2724b02, (int)0x57e31f8f, (int)0x2a6655ab,
            (int)0x07b2eb28, (int)0x032fb5c2, (int)0x9a86c57b, (int)0xa5d33708,
            (int)0xf2302887, (int)0xb223bfa5, (int)0xba02036a, (int)0x5ced1682,
            (int)0x2b8acf1c, (int)0x92a779b4, (int)0xf0f307f2, (int)0xa14e69e2,
            (int)0xcd65daf4, (int)0xd50605be, (int)0x1fd13462, (int)0x8ac4a6fe,
            (int)0x9d342e53, (int)0xa0a2f355, (int)0x32058ae1, (int)0x75a4f6eb,
            (int)0x390b83ec, (int)0xaa4060ef, (int)0x065e719f, (int)0x51bd6e10,
            (int)0xf93e218a, (int)0x3d96dd06, (int)0xaedd3e05, (int)0x464de6bd,
            (int)0xb591548d, (int)0x0571c45d, (int)0x6f0406d4, (int)0xff605015,
            (int)0x241998fb, (int)0x97d6bde9, (int)0xcc894043, (int)0x7767d99e,
            (int)0xbdb0e842, (int)0x8807898b, (int)0x38e7195b, (int)0xdb79c8ee,
            (int)0x47a17c0a, (int)0xe97c420f, (int)0xc9f8841e, (int)0x00000000,
            (int)0x83098086, (int)0x48322bed, (int)0xac1e1170, (int)0x4e6c5a72,
            (int)0xfbfd0eff, (int)0x560f8538, (int)0x1e3daed5, (int)0x27362d39,
            (int)0x640a0fd9, (int)0x21685ca6, (int)0xd19b5b54, (int)0x3a24362e,
            (int)0xb10c0a67, (int)0x0f9357e7, (int)0xd2b4ee96, (int)0x9e1b9b91,
            (int)0x4f80c0c5, (int)0xa261dc20, (int)0x695a774b, (int)0x161c121a,
            (int)0x0ae293ba, (int)0xe5c0a02a, (int)0x433c22e0, (int)0x1d121b17,
            (int)0x0b0e090d, (int)0xadf28bc7, (int)0xb92db6a8, (int)0xc8141ea9,
            (int)0x8557f119, (int)0x4caf7507, (int)0xbbee99dd, (int)0xfda37f60,
            (int)0x9ff70126, (int)0xbc5c72f5, (int)0xc544663b, (int)0x345bfb7e,
            (int)0x768b4329, (int)0xdccb23c6, (int)0x68b6edfc, (int)0x63b8e4f1,
            (int)0xcad731dc, (int)0x10426385, (int)0x40139722, (int)0x2084c611,
            (int)0x7d854a24, (int)0xf8d2bb3d, (int)0x11aef932, (int)0x6dc729a1,
            (int)0x4b1d9e2f, (int)0xf3dcb230, (int)0xec0d8652, (int)0xd077c1e3,
            (int)0x6c2bb316, (int)0x99a970b9, (int)0xfa119448, (int)0x2247e964,
            (int)0xc4a8fc8c, (int)0x1aa0f03f, (int)0xd8567d2c, (int)0xef223390,
            (int)0xc787494e, (int)0xc1d938d1, (int)0xfe8ccaa2, (int)0x3698d40b,
            (int)0xcfa6f581, (int)0x28a57ade, (int)0x26dab78e, (int)0xa43fadbf,
            (int)0xe42c3a9d, (int)0x0d507892, (int)0x9b6a5fcc, (int)0x62547e46,
            (int)0xc2f68d13, (int)0xe890d8b8, (int)0x5e2e39f7, (int)0xf582c3af,
            (int)0xbe9f5d80, (int)0x7c69d093, (int)0xa96fd52d, (int)0xb3cf2512,
            (int)0x3bc8ac99, (int)0xa710187d, (int)0x6ee89c63, (int)0x7bdb3bbb,
            (int)0x09cd2678, (int)0xf46e5918, (int)0x01ec9ab7, (int)0xa8834f9a,
            (int)0x65e6956e, (int)0x7eaaffe6, (int)0x0821bccf, (int)0xe6ef15e8,
            (int)0xd9bae79b, (int)0xce4a6f36, (int)0xd4ea9f09, (int)0xd629b07c,
            (int)0xaf31a4b2, (int)0x312a3f23, (int)0x30c6a594, (int)0xc035a266,
            (int)0x37744ebc, (int)0xa6fc82ca, (int)0xb0e090d0, (int)0x1533a7d8,
            (int)0x4af10498, (int)0xf741ecda, (int)0x0e7fcd50, (int)0x2f1791f6,
            (int)0x8d764dd6, (int)0x4d43efb0, (int)0x54ccaa4d, (int)0xdfe49604,
            (int)0xe39ed1b5, (int)0x1b4c6a88, (int)0xb8c12c1f, (int)0x7f466551,
            (int)0x049d5eea, (int)0x5d018c35, (int)0x73fa8774, (int)0x2efb0b41,
            (int)0x5ab3671d, (int)0x5292dbd2, (int)0x33e91056, (int)0x136dd647,
            (int)0x8c9ad761, (int)0x7a37a10c, (int)0x8e59f814, (int)0x89eb133c,
            (int)0xeecea927, (int)0x35b761c9, (int)0xede11ce5, (int)0x3c7a47b1,
            (int)0x599cd2df, (int)0x3f55f273, (int)0x791814ce, (int)0xbf73c737,
            (int)0xea53f7cd, (int)0x5b5ffdaa, (int)0x14df3d6f, (int)0x867844db,
            (int)0x81caaff3, (int)0x3eb968c4, (int)0x2c382434, (int)0x5fc2a340,
            (int)0x72161dc3, (int)0x0cbce225, (int)0x8b283c49, (int)0x41ff0d95,
            (int)0x7139a801, (int)0xde080cb3, (int)0x9cd8b4e4, (int)0x906456c1,
            (int)0x617bcb84, (int)0x70d532b6, (int)0x74486c5c, (int)0x42d0b857,
        };

	 private static final int[] Td2 = {
            (int)0xa75051f4, (int)0x65537e41, (int)0xa4c31a17, (int)0x5e963a27,
            (int)0x6bcb3bab, (int)0x45f11f9d, (int)0x58abacfa, (int)0x03934be3,
            (int)0xfa552030, (int)0x6df6ad76, (int)0x769188cc, (int)0x4c25f502,
            (int)0xd7fc4fe5, (int)0xcbd7c52a, (int)0x44802635, (int)0xa38fb562,
            (int)0x5a49deb1, (int)0x1b6725ba, (int)0x0e9845ea, (int)0xc0e15dfe,
            (int)0x7502c32f, (int)0xf012814c, (int)0x97a38d46, (int)0xf9c66bd3,
            (int)0x5fe7038f, (int)0x9c951592, (int)0x7aebbf6d, (int)0x59da9552,
            (int)0x832dd4be, (int)0x21d35874, (int)0x692949e0, (int)0xc8448ec9,
            (int)0x896a75c2, (int)0x7978f48e, (int)0x3e6b9958, (int)0x71dd27b9,
            (int)0x4fb6bee1, (int)0xad17f088, (int)0xac66c920, (int)0x3ab47dce,
            (int)0x4a1863df, (int)0x3182e51a, (int)0x33609751, (int)0x7f456253,
            (int)0x77e0b164, (int)0xae84bb6b, (int)0xa01cfe81, (int)0x2b94f908,
            (int)0x68587048, (int)0xfd198f45, (int)0x6c8794de, (int)0xf8b7527b,
            (int)0xd323ab73, (int)0x02e2724b, (int)0x8f57e31f, (int)0xab2a6655,
            (int)0x2807b2eb, (int)0xc2032fb5, (int)0x7b9a86c5, (int)0x08a5d337,
            (int)0x87f23028, (int)0xa5b223bf, (int)0x6aba0203, (int)0x825ced16,
            (int)0x1c2b8acf, (int)0xb492a779, (int)0xf2f0f307, (int)0xe2a14e69,
            (int)0xf4cd65da, (int)0xbed50605, (int)0x621fd134, (int)0xfe8ac4a6,
            (int)0x539d342e, (int)0x55a0a2f3, (int)0xe132058a, (int)0xeb75a4f6,
            (int)0xec390b83, (int)0xefaa4060, (int)0x9f065e71, (int)0x1051bd6e,
            (int)0x8af93e21, (int)0x063d96dd, (int)0x05aedd3e, (int)0xbd464de6,
            (int)0x8db59154, (int)0x5d0571c4, (int)0xd46f0406, (int)0x15ff6050,
            (int)0xfb241998, (int)0xe997d6bd, (int)0x43cc8940, (int)0x9e7767d9,
            (int)0x42bdb0e8, (int)0x8b880789, (int)0x5b38e719, (int)0xeedb79c8,
            (int)0x0a47a17c, (int)0x0fe97c42, (int)0x1ec9f884, (int)0x00000000,
            (int)0x86830980, (int)0xed48322b, (int)0x70ac1e11, (int)0x724e6c5a,
            (int)0xfffbfd0e, (int)0x38560f85, (int)0xd51e3dae, (int)0x3927362d,
            (int)0xd9640a0f, (int)0xa621685c, (int)0x54d19b5b, (int)0x2e3a2436,
            (int)0x67b10c0a, (int)0xe70f9357, (int)0x96d2b4ee, (int)0x919e1b9b,
            (int)0xc54f80c0, (int)0x20a261dc, (int)0x4b695a77, (int)0x1a161c12,
            (int)0xba0ae293, (int)0x2ae5c0a0, (int)0xe0433c22, (int)0x171d121b,
            (int)0x0d0b0e09, (int)0xc7adf28b, (int)0xa8b92db6, (int)0xa9c8141e,
            (int)0x198557f1, (int)0x074caf75, (int)0xddbbee99, (int)0x60fda37f,
            (int)0x269ff701, (int)0xf5bc5c72, (int)0x3bc54466, (int)0x7e345bfb,
            (int)0x29768b43, (int)0xc6dccb23, (int)0xfc68b6ed, (int)0xf163b8e4,
            (int)0xdccad731, (int)0x85104263, (int)0x22401397, (int)0x112084c6,
            (int)0x247d854a, (int)0x3df8d2bb, (int)0x3211aef9, (int)0xa16dc729,
            (int)0x2f4b1d9e, (int)0x30f3dcb2, (int)0x52ec0d86, (int)0xe3d077c1,
            (int)0x166c2bb3, (int)0xb999a970, (int)0x48fa1194, (int)0x642247e9,
            (int)0x8cc4a8fc, (int)0x3f1aa0f0, (int)0x2cd8567d, (int)0x90ef2233,
            (int)0x4ec78749, (int)0xd1c1d938, (int)0xa2fe8cca, (int)0x0b3698d4,
            (int)0x81cfa6f5, (int)0xde28a57a, (int)0x8e26dab7, (int)0xbfa43fad,
            (int)0x9de42c3a, (int)0x920d5078, (int)0xcc9b6a5f, (int)0x4662547e,
            (int)0x13c2f68d, (int)0xb8e890d8, (int)0xf75e2e39, (int)0xaff582c3,
            (int)0x80be9f5d, (int)0x937c69d0, (int)0x2da96fd5, (int)0x12b3cf25,
            (int)0x993bc8ac, (int)0x7da71018, (int)0x636ee89c, (int)0xbb7bdb3b,
            (int)0x7809cd26, (int)0x18f46e59, (int)0xb701ec9a, (int)0x9aa8834f,
            (int)0x6e65e695, (int)0xe67eaaff, (int)0xcf0821bc, (int)0xe8e6ef15,
            (int)0x9bd9bae7, (int)0x36ce4a6f, (int)0x09d4ea9f, (int)0x7cd629b0,
            (int)0xb2af31a4, (int)0x23312a3f, (int)0x9430c6a5, (int)0x66c035a2,
            (int)0xbc37744e, (int)0xcaa6fc82, (int)0xd0b0e090, (int)0xd81533a7,
            (int)0x984af104, (int)0xdaf741ec, (int)0x500e7fcd, (int)0xf62f1791,
            (int)0xd68d764d, (int)0xb04d43ef, (int)0x4d54ccaa, (int)0x04dfe496,
            (int)0xb5e39ed1, (int)0x881b4c6a, (int)0x1fb8c12c, (int)0x517f4665,
            (int)0xea049d5e, (int)0x355d018c, (int)0x7473fa87, (int)0x412efb0b,
            (int)0x1d5ab367, (int)0xd25292db, (int)0x5633e910, (int)0x47136dd6,
            (int)0x618c9ad7, (int)0x0c7a37a1, (int)0x148e59f8, (int)0x3c89eb13,
            (int)0x27eecea9, (int)0xc935b761, (int)0xe5ede11c, (int)0xb13c7a47,
            (int)0xdf599cd2, (int)0x733f55f2, (int)0xce791814, (int)0x37bf73c7,
            (int)0xcdea53f7, (int)0xaa5b5ffd, (int)0x6f14df3d, (int)0xdb867844,
            (int)0xf381caaf, (int)0xc43eb968, (int)0x342c3824, (int)0x405fc2a3,
            (int)0xc372161d, (int)0x250cbce2, (int)0x498b283c, (int)0x9541ff0d,
            (int)0x017139a8, (int)0xb3de080c, (int)0xe49cd8b4, (int)0xc1906456,
            (int)0x84617bcb, (int)0xb670d532, (int)0x5c74486c, (int)0x5742d0b8,
        };

	 private static final int[] Td3 = {
            (int)0xf4a75051, (int)0x4165537e, (int)0x17a4c31a, (int)0x275e963a,
            (int)0xab6bcb3b, (int)0x9d45f11f, (int)0xfa58abac, (int)0xe303934b,
            (int)0x30fa5520, (int)0x766df6ad, (int)0xcc769188, (int)0x024c25f5,
            (int)0xe5d7fc4f, (int)0x2acbd7c5, (int)0x35448026, (int)0x62a38fb5,
            (int)0xb15a49de, (int)0xba1b6725, (int)0xea0e9845, (int)0xfec0e15d,
            (int)0x2f7502c3, (int)0x4cf01281, (int)0x4697a38d, (int)0xd3f9c66b,
            (int)0x8f5fe703, (int)0x929c9515, (int)0x6d7aebbf, (int)0x5259da95,
            (int)0xbe832dd4, (int)0x7421d358, (int)0xe0692949, (int)0xc9c8448e,
            (int)0xc2896a75, (int)0x8e7978f4, (int)0x583e6b99, (int)0xb971dd27,
            (int)0xe14fb6be, (int)0x88ad17f0, (int)0x20ac66c9, (int)0xce3ab47d,
            (int)0xdf4a1863, (int)0x1a3182e5, (int)0x51336097, (int)0x537f4562,
            (int)0x6477e0b1, (int)0x6bae84bb, (int)0x81a01cfe, (int)0x082b94f9,
            (int)0x48685870, (int)0x45fd198f, (int)0xde6c8794, (int)0x7bf8b752,
            (int)0x73d323ab, (int)0x4b02e272, (int)0x1f8f57e3, (int)0x55ab2a66,
            (int)0xeb2807b2, (int)0xb5c2032f, (int)0xc57b9a86, (int)0x3708a5d3,
            (int)0x2887f230, (int)0xbfa5b223, (int)0x036aba02, (int)0x16825ced,
            (int)0xcf1c2b8a, (int)0x79b492a7, (int)0x07f2f0f3, (int)0x69e2a14e,
            (int)0xdaf4cd65, (int)0x05bed506, (int)0x34621fd1, (int)0xa6fe8ac4,
            (int)0x2e539d34, (int)0xf355a0a2, (int)0x8ae13205, (int)0xf6eb75a4,
            (int)0x83ec390b, (int)0x60efaa40, (int)0x719f065e, (int)0x6e1051bd,
            (int)0x218af93e, (int)0xdd063d96, (int)0x3e05aedd, (int)0xe6bd464d,
            (int)0x548db591, (int)0xc45d0571, (int)0x06d46f04, (int)0x5015ff60,
            (int)0x98fb2419, (int)0xbde997d6, (int)0x4043cc89, (int)0xd99e7767,
            (int)0xe842bdb0, (int)0x898b8807, (int)0x195b38e7, (int)0xc8eedb79,
            (int)0x7c0a47a1, (int)0x420fe97c, (int)0x841ec9f8, (int)0x00000000,
            (int)0x80868309, (int)0x2bed4832, (int)0x1170ac1e, (int)0x5a724e6c,
            (int)0x0efffbfd, (int)0x8538560f, (int)0xaed51e3d, (int)0x2d392736,
            (int)0x0fd9640a, (int)0x5ca62168, (int)0x5b54d19b, (int)0x362e3a24,
            (int)0x0a67b10c, (int)0x57e70f93, (int)0xee96d2b4, (int)0x9b919e1b,
            (int)0xc0c54f80, (int)0xdc20a261, (int)0x774b695a, (int)0x121a161c,
            (int)0x93ba0ae2, (int)0xa02ae5c0, (int)0x22e0433c, (int)0x1b171d12,
            (int)0x090d0b0e, (int)0x8bc7adf2, (int)0xb6a8b92d, (int)0x1ea9c814,
            (int)0xf1198557, (int)0x75074caf, (int)0x99ddbbee, (int)0x7f60fda3,
            (int)0x01269ff7, (int)0x72f5bc5c, (int)0x663bc544, (int)0xfb7e345b,
            (int)0x4329768b, (int)0x23c6dccb, (int)0xedfc68b6, (int)0xe4f163b8,
            (int)0x31dccad7, (int)0x63851042, (int)0x97224013, (int)0xc6112084,
            (int)0x4a247d85, (int)0xbb3df8d2, (int)0xf93211ae, (int)0x29a16dc7,
            (int)0x9e2f4b1d, (int)0xb230f3dc, (int)0x8652ec0d, (int)0xc1e3d077,
            (int)0xb3166c2b, (int)0x70b999a9, (int)0x9448fa11, (int)0xe9642247,
            (int)0xfc8cc4a8, (int)0xf03f1aa0, (int)0x7d2cd856, (int)0x3390ef22,
            (int)0x494ec787, (int)0x38d1c1d9, (int)0xcaa2fe8c, (int)0xd40b3698,
            (int)0xf581cfa6, (int)0x7ade28a5, (int)0xb78e26da, (int)0xadbfa43f,
            (int)0x3a9de42c, (int)0x78920d50, (int)0x5fcc9b6a, (int)0x7e466254,
            (int)0x8d13c2f6, (int)0xd8b8e890, (int)0x39f75e2e, (int)0xc3aff582,
            (int)0x5d80be9f, (int)0xd0937c69, (int)0xd52da96f, (int)0x2512b3cf,
            (int)0xac993bc8, (int)0x187da710, (int)0x9c636ee8, (int)0x3bbb7bdb,
            (int)0x267809cd, (int)0x5918f46e, (int)0x9ab701ec, (int)0x4f9aa883,
            (int)0x956e65e6, (int)0xffe67eaa, (int)0xbccf0821, (int)0x15e8e6ef,
            (int)0xe79bd9ba, (int)0x6f36ce4a, (int)0x9f09d4ea, (int)0xb07cd629,
            (int)0xa4b2af31, (int)0x3f23312a, (int)0xa59430c6, (int)0xa266c035,
            (int)0x4ebc3774, (int)0x82caa6fc, (int)0x90d0b0e0, (int)0xa7d81533,
            (int)0x04984af1, (int)0xecdaf741, (int)0xcd500e7f, (int)0x91f62f17,
            (int)0x4dd68d76, (int)0xefb04d43, (int)0xaa4d54cc, (int)0x9604dfe4,
            (int)0xd1b5e39e, (int)0x6a881b4c, (int)0x2c1fb8c1, (int)0x65517f46,
            (int)0x5eea049d, (int)0x8c355d01, (int)0x877473fa, (int)0x0b412efb,
            (int)0x671d5ab3, (int)0xdbd25292, (int)0x105633e9, (int)0xd647136d,
            (int)0xd7618c9a, (int)0xa10c7a37, (int)0xf8148e59, (int)0x133c89eb,
            (int)0xa927eece, (int)0x61c935b7, (int)0x1ce5ede1, (int)0x47b13c7a,
            (int)0xd2df599c, (int)0xf2733f55, (int)0x14ce7918, (int)0xc737bf73,
            (int)0xf7cdea53, (int)0xfdaa5b5f, (int)0x3d6f14df, (int)0x44db8678,
            (int)0xaff381ca, (int)0x68c43eb9, (int)0x24342c38, (int)0xa3405fc2,
            (int)0x1dc37216, (int)0xe2250cbc, (int)0x3c498b28, (int)0x0d9541ff,
            (int)0xa8017139, (int)0x0cb3de08, (int)0xb4e49cd8, (int)0x56c19064,
            (int)0xcb84617b, (int)0x32b670d5, (int)0x6c5c7448, (int)0xb85742d0,
        };

	 private static final int[] Td4 = {
            (int)0x52525252, (int)0x09090909, (int)0x6a6a6a6a, (int)0xd5d5d5d5,
            (int)0x30303030, (int)0x36363636, (int)0xa5a5a5a5, (int)0x38383838,
            (int)0xbfbfbfbf, (int)0x40404040, (int)0xa3a3a3a3, (int)0x9e9e9e9e,
            (int)0x81818181, (int)0xf3f3f3f3, (int)0xd7d7d7d7, (int)0xfbfbfbfb,
            (int)0x7c7c7c7c, (int)0xe3e3e3e3, (int)0x39393939, (int)0x82828282,
            (int)0x9b9b9b9b, (int)0x2f2f2f2f, (int)0xffffffff, (int)0x87878787,
            (int)0x34343434, (int)0x8e8e8e8e, (int)0x43434343, (int)0x44444444,
            (int)0xc4c4c4c4, (int)0xdededede, (int)0xe9e9e9e9, (int)0xcbcbcbcb,
            (int)0x54545454, (int)0x7b7b7b7b, (int)0x94949494, (int)0x32323232,
            (int)0xa6a6a6a6, (int)0xc2c2c2c2, (int)0x23232323, (int)0x3d3d3d3d,
            (int)0xeeeeeeee, (int)0x4c4c4c4c, (int)0x95959595, (int)0x0b0b0b0b,
            (int)0x42424242, (int)0xfafafafa, (int)0xc3c3c3c3, (int)0x4e4e4e4e,
            (int)0x08080808, (int)0x2e2e2e2e, (int)0xa1a1a1a1, (int)0x66666666,
            (int)0x28282828, (int)0xd9d9d9d9, (int)0x24242424, (int)0xb2b2b2b2,
            (int)0x76767676, (int)0x5b5b5b5b, (int)0xa2a2a2a2, (int)0x49494949,
            (int)0x6d6d6d6d, (int)0x8b8b8b8b, (int)0xd1d1d1d1, (int)0x25252525,
            (int)0x72727272, (int)0xf8f8f8f8, (int)0xf6f6f6f6, (int)0x64646464,
            (int)0x86868686, (int)0x68686868, (int)0x98989898, (int)0x16161616,
            (int)0xd4d4d4d4, (int)0xa4a4a4a4, (int)0x5c5c5c5c, (int)0xcccccccc,
            (int)0x5d5d5d5d, (int)0x65656565, (int)0xb6b6b6b6, (int)0x92929292,
            (int)0x6c6c6c6c, (int)0x70707070, (int)0x48484848, (int)0x50505050,
            (int)0xfdfdfdfd, (int)0xedededed, (int)0xb9b9b9b9, (int)0xdadadada,
            (int)0x5e5e5e5e, (int)0x15151515, (int)0x46464646, (int)0x57575757,
            (int)0xa7a7a7a7, (int)0x8d8d8d8d, (int)0x9d9d9d9d, (int)0x84848484,
            (int)0x90909090, (int)0xd8d8d8d8, (int)0xabababab, (int)0x00000000,
            (int)0x8c8c8c8c, (int)0xbcbcbcbc, (int)0xd3d3d3d3, (int)0x0a0a0a0a,
            (int)0xf7f7f7f7, (int)0xe4e4e4e4, (int)0x58585858, (int)0x05050505,
            (int)0xb8b8b8b8, (int)0xb3b3b3b3, (int)0x45454545, (int)0x06060606,
            (int)0xd0d0d0d0, (int)0x2c2c2c2c, (int)0x1e1e1e1e, (int)0x8f8f8f8f,
            (int)0xcacacaca, (int)0x3f3f3f3f, (int)0x0f0f0f0f, (int)0x02020202,
            (int)0xc1c1c1c1, (int)0xafafafaf, (int)0xbdbdbdbd, (int)0x03030303,
            (int)0x01010101, (int)0x13131313, (int)0x8a8a8a8a, (int)0x6b6b6b6b,
            (int)0x3a3a3a3a, (int)0x91919191, (int)0x11111111, (int)0x41414141,
            (int)0x4f4f4f4f, (int)0x67676767, (int)0xdcdcdcdc, (int)0xeaeaeaea,
            (int)0x97979797, (int)0xf2f2f2f2, (int)0xcfcfcfcf, (int)0xcececece,
            (int)0xf0f0f0f0, (int)0xb4b4b4b4, (int)0xe6e6e6e6, (int)0x73737373,
            (int)0x96969696, (int)0xacacacac, (int)0x74747474, (int)0x22222222,
            (int)0xe7e7e7e7, (int)0xadadadad, (int)0x35353535, (int)0x85858585,
            (int)0xe2e2e2e2, (int)0xf9f9f9f9, (int)0x37373737, (int)0xe8e8e8e8,
            (int)0x1c1c1c1c, (int)0x75757575, (int)0xdfdfdfdf, (int)0x6e6e6e6e,
            (int)0x47474747, (int)0xf1f1f1f1, (int)0x1a1a1a1a, (int)0x71717171,
            (int)0x1d1d1d1d, (int)0x29292929, (int)0xc5c5c5c5, (int)0x89898989,
            (int)0x6f6f6f6f, (int)0xb7b7b7b7, (int)0x62626262, (int)0x0e0e0e0e,
            (int)0xaaaaaaaa, (int)0x18181818, (int)0xbebebebe, (int)0x1b1b1b1b,
            (int)0xfcfcfcfc, (int)0x56565656, (int)0x3e3e3e3e, (int)0x4b4b4b4b,
            (int)0xc6c6c6c6, (int)0xd2d2d2d2, (int)0x79797979, (int)0x20202020,
            (int)0x9a9a9a9a, (int)0xdbdbdbdb, (int)0xc0c0c0c0, (int)0xfefefefe,
            (int)0x78787878, (int)0xcdcdcdcd, (int)0x5a5a5a5a, (int)0xf4f4f4f4,
            (int)0x1f1f1f1f, (int)0xdddddddd, (int)0xa8a8a8a8, (int)0x33333333,
            (int)0x88888888, (int)0x07070707, (int)0xc7c7c7c7, (int)0x31313131,
            (int)0xb1b1b1b1, (int)0x12121212, (int)0x10101010, (int)0x59595959,
            (int)0x27272727, (int)0x80808080, (int)0xecececec, (int)0x5f5f5f5f,
            (int)0x60606060, (int)0x51515151, (int)0x7f7f7f7f, (int)0xa9a9a9a9,
            (int)0x19191919, (int)0xb5b5b5b5, (int)0x4a4a4a4a, (int)0x0d0d0d0d,
            (int)0x2d2d2d2d, (int)0xe5e5e5e5, (int)0x7a7a7a7a, (int)0x9f9f9f9f,
            (int)0x93939393, (int)0xc9c9c9c9, (int)0x9c9c9c9c, (int)0xefefefef,
            (int)0xa0a0a0a0, (int)0xe0e0e0e0, (int)0x3b3b3b3b, (int)0x4d4d4d4d,
            (int)0xaeaeaeae, (int)0x2a2a2a2a, (int)0xf5f5f5f5, (int)0xb0b0b0b0,
            (int)0xc8c8c8c8, (int)0xebebebeb, (int)0xbbbbbbbb, (int)0x3c3c3c3c,
            (int)0x83838383, (int)0x53535353, (int)0x99999999, (int)0x61616161,
            (int)0x17171717, (int)0x2b2b2b2b, (int)0x04040404, (int)0x7e7e7e7e,
            (int)0xbabababa, (int)0x77777777, (int)0xd6d6d6d6, (int)0x26262626,
            (int)0xe1e1e1e1, (int)0x69696969, (int)0x14141414, (int)0x63636363,
            (int)0x55555555, (int)0x21212121, (int)0x0c0c0c0c, (int)0x7d7d7d7d,
        };

	 	private static final int[] rcon =  {
            0x01000000, 0x02000000, 0x04000000, 0x08000000,
	        0x10000000, 0x20000000, 0x40000000, 0x80000000,
	        0x1B000000, 0x36000000, /* for 128-bit blocks, Rijndael never uses more than 10 rcon values */
        };

		private static int GETU32(byte[] pt, int start_idx)
        {
            int rtn = (((int)((pt)[0+start_idx] << 24)&0xff000000) ^ ((int)((pt)[1+start_idx] << 16)&0x00ff0000) ^ ((int)((pt)[2+start_idx] <<  8)&0x0000ff00) ^ ((int)(pt)[3+start_idx])&0x000000ff);
            return rtn;
        }
		private static int IGETU32(byte[] pt, int start_idx)
		{
			 int rtn = (((int)((pt)[0+start_idx] )&0x000000ff) ^ ((int)((pt)[1+start_idx] << 8)&0x0000ff00) ^ ((int)((pt)[2+start_idx] <<  16)&0x00ff0000) ^ ((int)(pt)[3+start_idx] << 24)&0xff000000);
            return rtn;
		}

		private static byte[] PUTU32(int st)
		{
			byte[] ct = new byte[4];
            (ct)[0] = (byte)(((st) >> 24)&0x000000ff);
            (ct)[1] = (byte)(((st) >> 16)&0x000000ff);
            (ct)[2] = (byte)(((st) >> 8)&0x000000ff);
            (ct)[3] = (byte)(st);

            return ct;
		}

		private static byte[] IPUTU32(int st)
		{
			byte[] ct = new byte[4];
            (ct)[3] = (byte)(((st) >> 24)&0x000000ff);
            (ct)[2] = (byte)(((st) >> 16)&0x000000ff);
            (ct)[1] = (byte)(((st) >> 8)&0x000000ff);
            (ct)[0] = (byte)(st);

            return ct;
		}

		private static byte int_to_byte(int[] input, int idx)
		{
			/*
			 * return (byte)((input[idx/4] >> ((idx%4)*4)) & 0x000000ff );
			 * */ 
			int tmp = input[idx / 4];
			tmp = tmp >> ((idx % 4) * 8);
			tmp = tmp & 0x000000ff;
			return (byte)tmp;			
			
		}
		
		private int[] rk;
		public AES128ECBUtil() {
			rk = null;
		}
		
		
		/*
		 * 반환값 : 암호화된 문자열의 총 길이가 반환된다. 음수일경우 에러가 발생한 경우
		 * 일반 문자열을 암호화 한다.
		 * 
		 * @param input   암호화할 문자열
		 * @param inputlen   암호화할 문자열의 길이
		 * @param key	암호화/복호화시 사용할 Key 값
		 * @param iv   
		 * @param keybits   암호화/복호화시 사용할 암호화 비트 128 , 192 , 256 중 선택한다.
		 * @param mode   암호화/복호화시 사용할 mode : sec_aes.MODE_ECB | sec_aes.MODE_CBC 중 선택
		 * 
		 * */
		public byte[] encrypt(byte[] input, int inputlen, byte[] key, byte[] iv, int keybits, int mode) throws Exception {

            byte[] temp;
            int numBlocks = (int)(inputlen / 16);
            int keylength = 0;
            int i=0;
            int j=0;
            byte[] block = new byte[16];
            int[] tmpiv = new int[4];

            byte[] key_byte = key;
			byte[] tmp_input = new byte[16];

            int padLen = 0;
            byte[] enc_output = null;

            if(input == null){
                throw new Exception("input is null");
            }
            
            if(inputlen <=0){
            	throw new Exception("input size is lesser than 0");
            }

            if (key == null){
            	throw new Exception("key is null");
            }
           
            if((keybits == 128) || (keybits == 192) || (keybits == 256) ) {
            	/* space */
            } else {
            	throw new Exception("keybist is wrong, only 128, 192, 256");
            }
            
            if((mode == MODE_ECB) || (mode == MODE_CBC) ) {
            } else {
            	throw new Exception("mode is wrong, only MODE_ECB, MODE_CBC");
            }

			keylength = key_byte.length * 8;
			if(keybits > keylength) {
				throw new Exception("bad keylength. min key length is " + keylength);
			}
            
            enc_output = new byte[(16*(numBlocks+1))];
            keylength = rijndaelKeySetupEnc(key_byte, keybits);

            switch(mode) {
            
                case MODE_ECB:
                    //for(i = numBlocks ; i > 0 ; i--)
                    for(i=0 ; i < numBlocks ; i++) {
                    	
                    	System.arraycopy(input, 16*i, tmp_input, 0 , 16);
                        temp = rijndaelEncrypt(keylength, tmp_input);
                        System.arraycopy(temp, 0, enc_output, 16*i, 16);
                    }
                    padLen = 16 - (inputlen - 16*numBlocks);
                    
                    System.arraycopy(input, 16*numBlocks, block, 0, 16-padLen);
                    for (int k = 0; k < padLen; k++) {
                        block[16 - padLen + k] = (byte)padLen;
                    }                    
                    
                    temp = rijndaelEncrypt(keylength, block);
                    System.arraycopy(temp, 0, enc_output, 16*i, 16);
                    break;

                case MODE_CBC:

                    tmpiv[0] = IGETU32(iv, 0);
					tmpiv[1] = IGETU32(iv, 4);
					tmpiv[2] = IGETU32(iv, 8);
					tmpiv[3] = IGETU32(iv, 12);

					for (i = 0; i < numBlocks; i++)	{
						System.arraycopy(input, 16 * i, tmp_input, 0, 16);

						temp = IPUTU32((IGETU32(tmp_input, 0) ^ tmpiv[0]));
						System.arraycopy(temp, 0, block, 0, 4);

						temp = IPUTU32((IGETU32(tmp_input, 4) ^ tmpiv[1]));
						System.arraycopy(temp, 0, block, 4, 4);

						temp = IPUTU32((IGETU32(tmp_input, 8) ^ tmpiv[2]));
						System.arraycopy(temp, 0, block, 8, 4);

						temp = IPUTU32((IGETU32(tmp_input, 12) ^ tmpiv[3]));
						System.arraycopy(temp, 0, block, 12, 4);

						temp = null;
						temp = rijndaelEncrypt(keylength, block);
						System.arraycopy(temp, 0, enc_output, 16*i, 16);

						tmpiv[0] = IGETU32(temp, 0);
						tmpiv[1] = IGETU32(temp, 4);
						tmpiv[2] = IGETU32(temp, 8);
						tmpiv[3] = IGETU32(temp, 12);
					}

					padLen = 16 - (inputlen - 16 * numBlocks);
					System.arraycopy(input, 16 * i, tmp_input, 0, 16 - padLen);

					for (j = 0; j < 16 - padLen; j++) {
						block[j] = (byte) (tmp_input[j] ^int_to_byte(tmpiv, j));
					}
					
					for (j = 16 - padLen; j < 16; j++) {
						block[j] = (byte)(padLen ^ int_to_byte(tmpiv, j));
					}
					
					temp = rijndaelEncrypt(keylength, block);
					System.arraycopy(temp, 0, enc_output, 16*i, 16);
					break;   
                default:
                	throw new Exception("mode is wrong, only MODE_ECB, MODE_CBC");

            }
            return enc_output;
        }

		public static byte[] decrypt(byte[] userKey, byte[] param)
		{	
			byte[] output = null;
			if(param == null) {
				return null;
			}
			if(userKey == null){
				return null;
			}
			AES128ECBUtil aes = new AES128ECBUtil();
			
			int this_mode = mode;
			byte[] key = new byte[16];
			byte[] iv = new byte[16];
			if(userKey.length >= 32) {
				System.arraycopy(userKey, 0, key, 0, 16);
				System.arraycopy(userKey, 16, iv, 0, 16);
			} else {
				System.arraycopy(userKey, 0, key, 0, 16);
			}
			
			try
			{
				if(this_mode == AES128ECBUtil.MODE_ECB) {
//					output = aes.decrypt(param, param.length, key, null, ChatONAccessTokenEnc.KEYBITS_128, ChatONAccessTokenEnc.MODE_ECB);
					output = aes.decrypt(param, param.length, key, null, AES128ECBUtil.KEYBITS_128, AES128ECBUtil.MODE_ECB);
				} else if(this_mode == AES128ECBUtil.MODE_CBC) {
					output = aes.decrypt(param, param.length, key, iv, AES128ECBUtil.KEYBITS_128, AES128ECBUtil.MODE_CBC);					
				} else {
					throw new Exception("mode is wrong, only MODE_ECB, MODE_CBC");
				}
			} catch(Exception ex) {
				return null;
			}
			
			return output;
		}
		
		
		public  static String decryptString(byte[] userKey, byte[] param) {
			String result = null;
			if(param == null) {
				return null;
			}
			
			if(param.length <=0) {
				return null;
			}
			
			AES128ECBUtil aes = new AES128ECBUtil();
			
			try {
				if(mode == AES128ECBUtil.MODE_ECB) {
					byte[] output = aes.decrypt(param, param.length, key, null, AES128ECBUtil.KEYBITS_128, AES128ECBUtil.MODE_ECB);					
					result = new String(output, "UTF-8");
				} else if(mode == AES128ECBUtil.MODE_CBC) {
					byte[] output = aes.decrypt(param, param.length, internal_key, internal_iv, AES128ECBUtil.KEYBITS_128, AES128ECBUtil.MODE_CBC);					
					result = new String(output, "UTF-8");
				} else {
					result = new String(param, "UTF-8");
				}
			} catch(Exception ex) {
				ex.printStackTrace();
				return null;
			}
			
			if(result != null) {
				result = result.trim();
			}
			
			return result;
		}
		
		public static String decryptString(byte[] param) {
			String result = null;
			if(param == null) {
				return null;
			}
			
			if(param.length <=0) {
				return null;
			}
			
			AES128ECBUtil aes = new AES128ECBUtil();
			
			try	{
				if(mode == AES128ECBUtil.MODE_ECB) {
					byte[] output = aes.decrypt(param, param.length, key, null, AES128ECBUtil.KEYBITS_128, AES128ECBUtil.MODE_ECB);	
					result = new String(output, "UTF-8");
				} else if(mode == AES128ECBUtil.MODE_CBC) {
					byte[] output = aes.decrypt(param, param.length, internal_key, internal_iv, AES128ECBUtil.KEYBITS_128, AES128ECBUtil.MODE_CBC);					
					result = new String(output, "UTF-8");
				} else {
					result = new String(param, "UTF-8");
				}
			} catch(Exception ex) {
				ex.printStackTrace();
				return null;
			}
			 
			if(result != null) {
				result = result.trim();
			}
			return result;
		}
		
		public static byte[] encrypt(String param) {
			
			if(param == null ) {
				return null;
			}
			
			if(param.length() <= 0 ) {
				return null;
			}
			
			try	{
				byte[] input = param.getBytes("UTF-8");
				
				if(mode == AES128ECBUtil.MODE_ECB) {
					AES128ECBUtil aes = new AES128ECBUtil();
					return aes.encrypt(input, input.length, key, null, AES128ECBUtil.KEYBITS_128, AES128ECBUtil.MODE_ECB);
				} else if(mode == AES128ECBUtil.MODE_CBC) {
					AES128ECBUtil aes = new AES128ECBUtil();
					return aes.encrypt(input, input.length, internal_key, internal_iv, AES128ECBUtil.KEYBITS_128, AES128ECBUtil.MODE_CBC);
				} else {
					return input;
				}
			}
			catch(Exception ex)
			{
				ex.printStackTrace();
				return null;
			}
			
		}
		public static byte[] encrypt(byte[] param) {
			
			if(param == null) {
				return null;
			}
			
			try	{
				
				if(mode == AES128ECBUtil.MODE_ECB) {
					AES128ECBUtil aes = new AES128ECBUtil();
					return aes.encrypt(param, param.length, key, null, AES128ECBUtil.KEYBITS_128, AES128ECBUtil.MODE_ECB);
				} else if(mode == AES128ECBUtil.MODE_CBC) {
					AES128ECBUtil aes = new AES128ECBUtil();
					return aes.encrypt(param, param.length, internal_key, internal_iv, AES128ECBUtil.KEYBITS_128, AES128ECBUtil.MODE_CBC);
				} else {			
					return param;				
				}
			
			}
			catch(Exception ex)	{
				return null;
			}
		}
		
		public static byte[] encrypt(byte[] userKey, String param) {
			
			if(param == null ) return null;
			
			try	{
				byte[] input = param.getBytes("UTF-8");
				if(mode == AES128ECBUtil.MODE_ECB) {
					AES128ECBUtil aes = new AES128ECBUtil();
//					return aes.encrypt(input, input.length, key, null, ChatONAccessTokenEnc.KEYBITS_128, ChatONAccessTokenEnc.MODE_ECB);
					return aes.encrypt(input, input.length, userKey, null, AES128ECBUtil.KEYBITS_128, AES128ECBUtil.MODE_ECB);
				} else if(mode == AES128ECBUtil.MODE_CBC) {
					AES128ECBUtil aes = new AES128ECBUtil();
					return aes.encrypt(input, input.length, internal_key, internal_iv, AES128ECBUtil.KEYBITS_128, AES128ECBUtil.MODE_CBC);
				} else {
					return input;
				}
			} catch(Exception ex) {
				return null;
			}
		}
		
		public static byte[] encrypt(byte[] userKey, byte[] param) {
			
			if(param == null) return null;
			int this_mode = mode;
			byte[] key = new byte[16];
			byte[] iv = new byte[16];
			if(userKey.length >= 32) {
				System.arraycopy(userKey, 0, key, 0, 16);
				System.arraycopy(userKey, 16, iv, 0, 16);
			} else {
				System.arraycopy(userKey, 0, key, 0, 16);
			}
			
			try	{
				
				if(this_mode == AES128ECBUtil.MODE_ECB) {
					AES128ECBUtil aes = new AES128ECBUtil();
					return aes.encrypt(param, param.length, key, iv, AES128ECBUtil.KEYBITS_128, AES128ECBUtil.MODE_ECB);
				} else if(this_mode == AES128ECBUtil.MODE_CBC) {
					AES128ECBUtil aes = new AES128ECBUtil();
					return aes.encrypt(param, param.length, key, iv, AES128ECBUtil.KEYBITS_128, AES128ECBUtil.MODE_CBC);
				} else {			
					return param;				
				}
			} catch(Exception ex) {
				return null;
			}
		}
		

		/*
		 * 반환값 : 복호한된 문자열의 총 길이가 반환된다. 음수일경우 에러가 발생한 경우
		 * 암호화된 문자열을 복호화 한다.
		 * @param input 복호화할 문자열
		 * @param inputlen 복호화할 문자열의 길이
		 * @param key 암호화/복호화시 사용할 Key 값
		 * @param iv 
		 * @param keybits 암호화/복호화시 사용할 암호화 비트 128 , 192 중 선택한다.
		 * @param mode 암호화/복호화시 사용할 mode : AESVW_MODE_ECB | AESVW_MODE_CBC 중 선택
		 * 
		 * **/
        public byte[] decrypt(byte[] input, int inputlen, byte[] key, byte[] iv, int keybits, int mode) throws Exception {

        	byte[] temp;
        	byte[] temp2;
            byte[] dec_output = null;
            int dec_output_length = 0;
        	
	        int numBlocks = (int)(inputlen / 16);
	        int keylength = 0;
	        int i=0;
	        int j=0;
	        byte[] block = new byte[16];
	        byte[] tmp_input = new byte[16];
            
            int[] tmpiv = new int[4];
            byte[] key_byte = key;

            int padLen = 0;

	        if(input == null) {
	        	 throw new Exception("input is null");
	        }
	        
	        if(inputlen <=0) {
	        	throw new Exception("input size is lesser than 0");
	        }

            if (key == null) {
            	throw new Exception("key is null");
	        }
	        
	        if((keybits == 128) || (keybits == 192) || (keybits == 256) ) {
	        } else {
	        	throw new Exception("keybist is wrong, only 128, 192, 256");
	        }

	        if(inputlen % 16 != 0) {
	        	throw new Exception("input data is wrong");
	        }
	        
	        if((mode == MODE_ECB) || (mode == MODE_CBC) ){
	        } else {
	        	throw new Exception("mode is wrong, only MODE_ECB, MODE_CBC");
	        }

	        dec_output = new byte[(16*(numBlocks+1))];
	        keylength = rijndaelKeySetupDec(key_byte, keybits);
        
	        switch(mode) {
		        case AES128ECBUtil.MODE_ECB:
			        //for(i = numBlocks ; i > 0 ; i--)
			        for(i=0 ; i < numBlocks-1 ; i++) {
						System.arraycopy(input, 16*i, tmp_input, 0 , 16);
                        temp = rijndaelDecrypt(keylength, tmp_input);
                        System.arraycopy(temp, 0, dec_output, 16*i , 16);
                        dec_output_length = dec_output_length + 16;
			        }
			        System.arraycopy(input, 16*i, tmp_input, 0 , 16);
					
			        block = rijndaelDecrypt(keylength, tmp_input);
			        padLen = block[15];
			        if(padLen > 16) {
			        	throw new Exception("input data is wrong");
			        }
			        
			        for(j= 16 -padLen ; j< 16;j++) {
				        if(block[j] != padLen) {
				        	throw new Exception("input data is wrong");
				        }
			        }
                  
                    System.arraycopy(block, 0, dec_output, 16*i , 16-padLen);
                    dec_output_length = dec_output_length + (16-padLen);
			        break;

		        case AES128ECBUtil.MODE_CBC:

					tmpiv[0] = IGETU32(iv, 0);
					tmpiv[1] = IGETU32(iv, 4);
					tmpiv[2] = IGETU32(iv, 8);
					tmpiv[3] = IGETU32(iv, 12);

					for (i = 0; i < numBlocks - 1; i++) {
						System.arraycopy(input, 16 * i, tmp_input, 0, 16);
						temp = rijndaelDecrypt(keylength, tmp_input);
						
						temp2 = IPUTU32((IGETU32(temp, 0) ^ tmpiv[0]));
						System.arraycopy(temp2, 0, block, 0, 4);
						
						temp2 = IPUTU32((IGETU32(temp, 4) ^ tmpiv[1]));
						System.arraycopy(temp2, 0, block, 4, 4);
						
						temp2 = IPUTU32((IGETU32(temp, 8) ^ tmpiv[2]));
						System.arraycopy(temp2, 0, block, 8, 4);

						temp2 = IPUTU32((IGETU32(temp, 12) ^ tmpiv[3]));
						System.arraycopy(temp2, 0, block, 12, 4);
						
						tmpiv[0] = IGETU32(tmp_input, 0);
						tmpiv[1] = IGETU32(tmp_input, 4);
						tmpiv[2] = IGETU32(tmp_input, 8);
						tmpiv[3] = IGETU32(tmp_input, 12);

						System.arraycopy(block, 0, dec_output, 16*i , 16);
						dec_output_length = dec_output_length + 16;
					}

					System.arraycopy(input, 16 * i, tmp_input, 0, 16);
					
					temp = rijndaelDecrypt(keylength, tmp_input);
					temp2 = IPUTU32((IGETU32(temp, 0) ^ tmpiv[0]));
					System.arraycopy(temp2, 0, block, 0, 4);

					temp2 = IPUTU32((IGETU32(temp, 4) ^ tmpiv[1]));
					System.arraycopy(temp2, 0, block, 4, 4);

					temp2 = IPUTU32((IGETU32(temp, 8) ^ tmpiv[2]));
					System.arraycopy(temp2, 0, block, 8, 4);

					temp2 = IPUTU32((IGETU32(temp, 12) ^ tmpiv[3]));					
					System.arraycopy(temp2, 0, block, 12, 4);
					
					padLen = (int)block[15];

					if (padLen <= 0 || padLen > 16) {
						throw new Exception("input data is wrong");
					}
					
					for (j = 16 - padLen; j < 16; j++) {
						if (block[j] != padLen)	{
							throw new Exception("input data is wrong");
						}
					}				
					
					System.arraycopy(block, 0, dec_output, 16*i, 16-padLen);
					dec_output_length = dec_output_length + (16-padLen);
					break;
		        default:
		        	throw new Exception("mode is wrong, only MODE_ECB, MODE_CBC");

	        }
	
	        byte[] new_output = new byte[dec_output_length];
	        System.arraycopy(dec_output, 0, new_output, 0, dec_output_length);
	        
	        return new_output;
        }

        private int rijndaelKeySetupEnc(byte[] cipherKey, int keyBits) {
            int i =0;
            int temp;
            int temp_inc = 0;

            this.rk = new int[60];
            rk[0] = GETU32(cipherKey, 0);
            rk[1] = GETU32(cipherKey, 4);
            rk[2] = GETU32(cipherKey, 8);
            rk[3] = GETU32(cipherKey, 12);

            if(keyBits == 128) {
               for (;;) {
                   temp = rk[3 + temp_inc];
                   rk[4 + temp_inc] = rk[0 + temp_inc] ^
				        (Te4[(temp >> 16) & 0xff] & 0xff000000) ^
				        (Te4[(temp >>  8) & 0xff] & 0x00ff0000) ^
				        (Te4[(temp      ) & 0xff] & 0x0000ff00) ^
				        (Te4[(temp >> 24)&0x000000ff       ] & 0x000000ff) ^
				        rcon[i];
                   rk[5 + temp_inc] = rk[1 + temp_inc] ^ rk[4 + temp_inc];
                   rk[6 + temp_inc] = rk[2 + temp_inc] ^ rk[5 + temp_inc];
                   rk[7 + temp_inc] = rk[3 + temp_inc] ^ rk[6 + temp_inc];
			        if (++i == 10) {
				        return 10;
			        }
                    temp_inc += 4;
               }
            }
            
            rk[4 + temp_inc] = GETU32(cipherKey, 16);
            rk[5 + temp_inc] = GETU32(cipherKey, 20);
            if (keyBits == 192) {
		        for (;;) {
                    temp = rk[5 + temp_inc];
                    rk[6 + temp_inc] = rk[0 + temp_inc] ^
				        (Te4[(temp >> 16) & 0xff] & 0xff000000) ^
				        (Te4[(temp >>  8) & 0xff] & 0x00ff0000) ^
				        (Te4[(temp      ) & 0xff] & 0x0000ff00) ^
				        (Te4[(temp >> 24)&0x000000ff       ] & 0x000000ff) ^
				        rcon[i];
                    rk[7 + temp_inc] = rk[1 + temp_inc] ^ rk[6 + temp_inc];
                    rk[8 + temp_inc] = rk[2 + temp_inc] ^ rk[7 + temp_inc];
                    rk[9 + temp_inc] = rk[3 + temp_inc] ^ rk[8 + temp_inc];
			        if (++i == 8) {
				        return 12;
			        }
                    rk[10 + temp_inc] = rk[4 + temp_inc] ^ rk[9 + temp_inc];
                    rk[11 + temp_inc] = rk[5 + temp_inc] ^ rk[10 + temp_inc];
                    temp_inc += 6;
		        }
	        }

            rk[6 + temp_inc] = GETU32(cipherKey, 24);
            rk[7 + temp_inc] = GETU32(cipherKey, 28);

            if (keyBits == 256) {
                for (;;) {
                    temp = rk[7 + temp_inc];
                    rk[8 + temp_inc] = rk[0 + temp_inc] ^
        		        (Te4[(temp >> 16) & 0xff] & 0xff000000) ^
        		        (Te4[(temp >>  8) & 0xff] & 0x00ff0000) ^
        		        (Te4[(temp      ) & 0xff] & 0x0000ff00) ^
        		        (Te4[(temp >> 24)&0x000000ff       ] & 0x000000ff) ^
        		        rcon[i];
                    rk[9 + temp_inc] = rk[1 + temp_inc] ^ rk[8 + temp_inc];
                    rk[10 + temp_inc] = rk[2 + temp_inc] ^ rk[9 + temp_inc];
                    rk[11 + temp_inc] = rk[3 + temp_inc] ^ rk[10 + temp_inc];
			        if (++i == 7) {
				        return 14;
			        }
			        
                    temp = rk[11 + temp_inc];
                    rk[12 + temp_inc] = rk[4 + temp_inc] ^
        		        (Te4[(temp >> 24)&0x000000ff       ] & 0xff000000) ^
        		        (Te4[(temp >> 16) & 0xff] & 0x00ff0000) ^
        		        (Te4[(temp >>  8) & 0xff] & 0x0000ff00) ^
        		        (Te4[(temp      ) & 0xff] & 0x000000ff);
                    rk[13 + temp_inc] = rk[5 + temp_inc] ^ rk[12 + temp_inc];
                    rk[14 + temp_inc] = rk[6 + temp_inc] ^ rk[13 + temp_inc];
                    rk[15 + temp_inc] = rk[7 + temp_inc] ^ rk[14 + temp_inc];

                    temp_inc += 8;
                }
	        }
	        return 0;
        }

        private int rijndaelKeySetupDec(byte[] cipherKey, int keyBits) {
	        int Nr, i, j;
            int temp_inc = 0;
	        int temp;

			this.rk = null;
	        Nr = rijndaelKeySetupEnc(cipherKey, keyBits);
	        for (i = 0, j = 4*Nr; i < j; i += 4, j -= 4) {
		        temp = rk[i    ]; rk[i    ] = rk[j    ]; rk[j    ] = temp;
		        temp = rk[i + 1]; rk[i + 1] = rk[j + 1]; rk[j + 1] = temp;
		        temp = rk[i + 2]; rk[i + 2] = rk[j + 2]; rk[j + 2] = temp;
		        temp = rk[i + 3]; rk[i + 3] = rk[j + 3]; rk[j + 3] = temp;
	        }

	        for (i = 1; i < Nr; i++) {
                temp_inc += 4;

                rk[0 + temp_inc] =
                    Td0[Te4[(rk[0 + temp_inc] >> 24)&0x000000ff] & 0xff] ^
                    Td1[Te4[(rk[0 + temp_inc] >> 16) & 0xff] & 0xff] ^
                    Td2[Te4[(rk[0 + temp_inc] >> 8) & 0xff] & 0xff] ^
                    Td3[Te4[(rk[0 + temp_inc]) & 0xff] & 0xff];
                rk[1 + temp_inc] =
                    Td0[Te4[(rk[1 + temp_inc] >> 24)&0x000000ff] & 0xff] ^
                    Td1[Te4[(rk[1 + temp_inc] >> 16) & 0xff] & 0xff] ^
                    Td2[Te4[(rk[1 + temp_inc] >> 8) & 0xff] & 0xff] ^
                    Td3[Te4[(rk[1 + temp_inc]) & 0xff] & 0xff];
                rk[2 + temp_inc] =
                    Td0[Te4[(rk[2 + temp_inc] >> 24)&0x000000ff] & 0xff] ^
                    Td1[Te4[(rk[2 + temp_inc] >> 16)&0x0000ffff & 0xff] & 0xff] ^
                    Td2[Te4[(rk[2 + temp_inc] >> 8)&0x00ffffff & 0xff] & 0xff] ^
                    Td3[Te4[(rk[2 + temp_inc]) & 0xff] & 0xff];
                rk[3 + temp_inc] =
                    Td0[Te4[(rk[3 + temp_inc] >> 24)&0x000000ff] & 0xff] ^
                    Td1[Te4[(rk[3 + temp_inc] >> 16) & 0xff] & 0xff] ^
                    Td2[Te4[(rk[3 + temp_inc] >> 8) & 0xff] & 0xff] ^
                    Td3[Te4[(rk[3 + temp_inc]) & 0xff] & 0xff];
	        }
	        
	        return Nr;
        }

        private byte[] rijndaelEncrypt(int Nr, byte[] pt)    	
        {
            int s0, s1, s2, s3, t0, t1, t2, t3;        
            int r;
            byte[] temp;
            byte[] ct = new byte[16];
			int rk_inc = 0;
            /*
	         * map byte array block to cipher state
	         * and add initial round key:
	         */
	        s0 = GETU32(pt ,  0) ^ rk[0];
	        s1 = GETU32(pt ,  4) ^ rk[1];
	        s2 = GETU32(pt ,  8) ^ rk[2];
	        s3 = GETU32(pt , 12) ^ rk[3];
      
            /*
	         * Nr - 1 full rounds:
	         */
            /*r = Nr >> 1 &0x7fffffff;*/
			
	        r = Nr >> 1 ;
            for (;;) {
                t0 =
                    Te0[(s0 >> 24)&0x000000ff       ] ^
                    Te1[(s1 >> 16) & 0xff] ^
                    Te2[(s2 >>  8) & 0xff] ^
                    Te3[(s3      ) & 0xff] ^
                    rk[4+rk_inc];

                t1 =
                    Te0[(s1 >> 24)&0x000000ff       ] ^
                    Te1[(s2 >> 16) & 0xff] ^
                    Te2[(s3 >>  8) & 0xff] ^
                    Te3[(s0      ) & 0xff] ^
                    rk[5+rk_inc];
                t2 =
                    Te0[(s2 >> 24)&0x000000ff       ] ^
                    Te1[(s3 >> 16) & 0xff] ^
                    Te2[(s0 >>  8) & 0xff] ^
                    Te3[(s1      ) & 0xff] ^
                    rk[6+rk_inc];
                t3 =
                    Te0[(s3 >> 24)&0x000000ff       ] ^
                    Te1[(s0 >> 16) & 0xff] ^
                    Te2[(s1 >>  8) & 0xff] ^
                    Te3[(s2      ) & 0xff] ^
                    rk[7+rk_inc];

                rk_inc += 8;
                if (--r == 0) {
                    break;
                }

                s0 =
                    Te0[(t0 >> 24)&0x000000ff       ] ^
                    Te1[(t1 >> 16) & 0xff] ^
                    Te2[(t2 >>  8) & 0xff] ^
                    Te3[(t3      ) & 0xff] ^
                    rk[0+rk_inc];
                s1 =
                    Te0[(t1 >> 24)&0x000000ff       ] ^
                    Te1[(t2 >> 16) & 0xff] ^
                    Te2[(t3 >>  8) & 0xff] ^
                    Te3[(t0      ) & 0xff] ^
                    rk[1+rk_inc];
                s2 =
                    Te0[(t2 >> 24)&0x000000ff       ] ^
                    Te1[(t3 >> 16) & 0xff] ^
                    Te2[(t0 >>  8) & 0xff] ^
                    Te3[(t1      ) & 0xff] ^
                    rk[2+rk_inc];
                s3 =
                    Te0[(t3 >> 24)&0x000000ff       ] ^
                    Te1[(t0 >> 16) & 0xff] ^
                    Te2[(t1 >>  8) & 0xff] ^
                    Te3[(t2      ) & 0xff] ^
                    rk[3+rk_inc];
			
            }
       
            /*
	         * apply last round and
	         * map cipher state to byte array block:
	         */
	        s0 =
		        (Te4[(t0 >> 24)&0xff       ] & 0xff000000) ^
		        (Te4[(t1 >> 16) & 0xff] & 0x00ff0000) ^
		        (Te4[(t2 >>  8) & 0xff] & 0x0000ff00) ^
		        (Te4[(t3      ) & 0xff] & 0x000000ff) ^
		        rk[0+rk_inc];
            temp = PUTU32(s0);

            System.arraycopy(temp, 0, ct, 0, 4);
	        
	        s1 =
		        (Te4[(t1 >> 24)&0xff       ] & 0xff000000) ^
		        (Te4[(t2 >> 16) & 0xff] & 0x00ff0000) ^
		        (Te4[(t3 >>  8) & 0xff] & 0x0000ff00) ^
		        (Te4[(t0      ) & 0xff] & 0x000000ff) ^
		        rk[1+rk_inc];
	        temp = PUTU32(s1);
            
            System.arraycopy(temp, 0, ct, 4, 4);
	        s2 =
		        (Te4[(t2 >> 24)&0xff       ] & 0xff000000) ^
		        (Te4[(t3 >> 16) & 0xff] & 0x00ff0000) ^
		        (Te4[(t0 >>  8) & 0xff] & 0x0000ff00) ^
		        (Te4[(t1      ) & 0xff] & 0x000000ff) ^
		        rk[2+rk_inc];
	        temp = PUTU32(s2);
	        System.arraycopy(temp, 0, ct, 8, 4);
	        s3 =
		        (Te4[(t3 >> 24)&0xff       ] & 0xff000000) ^
		        (Te4[(t0 >> 16) & 0xff] & 0x00ff0000) ^
		        (Te4[(t1 >>  8) & 0xff] & 0x0000ff00) ^
		        (Te4[(t2      ) & 0xff] & 0x000000ff) ^
		        rk[3+rk_inc];
	        temp = PUTU32(s3);
	        System.arraycopy(temp, 0, ct, 12, 4);
			//System.gc();
			return ct;
        }

        
        private byte[] rijndaelDecrypt(int Nr, byte[] ct) {
           int s0, s1, s2, s3, t0, t1, t2, t3;
           byte[] temp;

           byte[] pt = new byte[16];
           int r;
		   int rk_inc = 0;
        

            /*
	         * map byte array block to cipher state
	         * and add initial round key:
	         */

			s0 = GETU32(ct ,  0) ^ rk[0];
            s1 = GETU32(ct ,  4) ^ rk[1];
            s2 = GETU32(ct ,  8) ^ rk[2];
            s3 = GETU32(ct , 12) ^ rk[3];


            /*
             * Nr - 1 full rounds:
             */
            r = Nr >> 1;
            for (;;) {
                t0 =
                    Td0[(s0 >> 24)&0x000000ff       ] ^
                    Td1[(s3 >> 16) & 0xff] ^
                    Td2[(s2 >>  8) & 0xff] ^
                    Td3[(s1      ) & 0xff] ^
                    rk[4+rk_inc];
                t1 =
                    Td0[(s1 >> 24)&0x000000ff       ] ^
                    Td1[(s0 >> 16) & 0xff] ^
                    Td2[(s3 >>  8) & 0xff] ^
                    Td3[(s2      ) & 0xff] ^
                    rk[5+rk_inc];
                t2 =
                    Td0[(s2 >> 24)&0x000000ff       ] ^
                    Td1[(s1 >> 16) & 0xff] ^
                    Td2[(s0 >>  8) & 0xff] ^
                    Td3[(s3      ) & 0xff] ^
                    rk[6+rk_inc];
                t3 =
                    Td0[(s3 >> 24)&0x000000ff       ] ^
                    Td1[(s2 >> 16) & 0xff] ^
                    Td2[(s1 >>  8) & 0xff] ^
                    Td3[(s0      ) & 0xff] ^
                    rk[7+rk_inc];

				rk_inc += 8;
                if (--r == 0) {
                    break;
                }

                s0 =
                    Td0[(t0 >> 24)&0x000000ff       ] ^
                    Td1[(t3 >> 16) & 0xff] ^
                    Td2[(t2 >>  8) & 0xff] ^
                    Td3[(t1      ) & 0xff] ^
                    rk[0+rk_inc];
                s1 =
                    Td0[(t1 >> 24)&0x000000ff       ] ^
                    Td1[(t0 >> 16) & 0xff] ^
                    Td2[(t3 >>  8) & 0xff] ^
                    Td3[(t2      ) & 0xff] ^
                    rk[1+rk_inc];
                s2 =
                    Td0[(t2 >> 24) &0x000000ff      ] ^
                    Td1[(t1 >> 16) & 0xff] ^
                    Td2[(t0 >>  8) & 0xff] ^
                    Td3[(t3      ) & 0xff] ^
                    rk[2+rk_inc];
                s3 =
                    Td0[(t3 >> 24)&0x000000ff       ] ^
                    Td1[(t2 >> 16) & 0xff] ^
                    Td2[(t1 >>  8) & 0xff] ^
                    Td3[(t0      ) & 0xff] ^
                    rk[3+rk_inc];
            }
        
            /*
	         * apply last round and
	         * map cipher state to byte array block:
	         */
   	        s0 =
   		        (Td4[(t0 >> 24)&0x000000ff       ] & 0xff000000) ^
   		        (Td4[(t3 >> 16) & 0xff] & 0x00ff0000) ^
   		        (Td4[(t2 >>  8) & 0xff] & 0x0000ff00) ^
   		        (Td4[(t1      ) & 0xff] & 0x000000ff) ^
   		        rk[0+rk_inc];
	        temp = PUTU32(s0);
	        System.arraycopy(temp, 0, pt, 0, 4);
   	        s1 =
   		        (Td4[(t1 >> 24)&0x000000ff       ] & 0xff000000) ^
   		        (Td4[(t0 >> 16) & 0xff] & 0x00ff0000) ^
   		        (Td4[(t3 >>  8) & 0xff] & 0x0000ff00) ^
   		        (Td4[(t2      ) & 0xff] & 0x000000ff) ^
   		        rk[1+rk_inc];
	        temp = PUTU32(s1);
            
            System.arraycopy(temp, 0, pt, 4, 4);
   	        s2 =
   		        (Td4[(t2 >> 24)&0x000000ff       ] & 0xff000000) ^
   		        (Td4[(t1 >> 16) & 0xff] & 0x00ff0000) ^
   		        (Td4[(t0 >>  8) & 0xff] & 0x0000ff00) ^
   		        (Td4[(t3      ) & 0xff] & 0x000000ff) ^
   		        rk[2+rk_inc];
	        temp = PUTU32(s2);
	        System.arraycopy(temp, 0, pt, 8, 4);
   	        s3 =
   		        (Td4[(t3 >> 24)&0x000000ff       ] & 0xff000000) ^
   		        (Td4[(t2 >> 16) & 0xff] & 0x00ff0000) ^
   		        (Td4[(t1 >>  8) & 0xff] & 0x0000ff00) ^
   		        (Td4[(t0      ) & 0xff] & 0x000000ff) ^
   		        rk[3+rk_inc];
	        temp = PUTU32(s3);
	        System.arraycopy(temp, 0, pt, 12, 4);

	        return pt;
        }
		
		
}